diff --git a/bash/maven_build.sh b/bash/maven_build.sh index 92a540fe54..9202735ffa 100755 --- a/bash/maven_build.sh +++ b/bash/maven_build.sh @@ -22,8 +22,8 @@ set -e COMMAND=$0 # set general variables to correctly execute the build process -export OVERTARGET_VERSION=1.1.0.r201903120902 -export OVERTARGET_REPO=https://sourceforge.net/projects/overtarget/files/release/1.1.0/25/plugins +export OVERTARGET_VERSION=1.2.1.r202007301216 +export OVERTARGET_REPO=https://sourceforge.net/projects/overtarget/files/release/1.2.1/483/plugins/ export OVERTARGET_GROUP=de.dlr.sc.overtarget export JUNIT_DEBUG_PROJECT_TEST_CASE=true export SWTBOT_SCREENSHOT=true diff --git a/build.xml b/build.xml index e423d79908..1d8945c167 100644 --- a/build.xml +++ b/build.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 Additional Build Preparations for VirSat - 4.12.0 + 4.12.1 [\s]?[0-9]+\.[0-9]+\.[0-9]+\.qualifier [\s]?[0-9]+\.[0-9]+\.[0-9]+ diff --git a/de.dlr.sc.virsat.apps.feature/feature.xml b/de.dlr.sc.virsat.apps.feature/feature.xml index 930d17c842..3a0ade836a 100644 --- a/de.dlr.sc.virsat.apps.feature/feature.xml +++ b/de.dlr.sc.virsat.apps.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.apps.feature/pom.xml b/de.dlr.sc.virsat.apps.feature/pom.xml index 12d83ac759..346833afde 100644 --- a/de.dlr.sc.virsat.apps.feature/pom.xml +++ b/de.dlr.sc.virsat.apps.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.apps.feature diff --git a/de.dlr.sc.virsat.apps.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.apps.test/META-INF/MANIFEST.MF index fce572495f..d8eed17115 100644 --- a/de.dlr.sc.virsat.apps.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.apps.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Java Model Access Tests Bundle-SymbolicName: de.dlr.sc.virsat.apps.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.apps Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.apps.test/pom.xml b/de.dlr.sc.virsat.apps.test/pom.xml index edbd204423..523a615f93 100644 --- a/de.dlr.sc.virsat.apps.test/pom.xml +++ b/de.dlr.sc.virsat.apps.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.apps.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.apps.ui/META-INF/MANIFEST.MF index 16cf1cc2a5..6ca58ef126 100644 --- a/de.dlr.sc.virsat.apps.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.apps.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Apps UI Bundle-SymbolicName: de.dlr.sc.virsat.apps.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.apps.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.apps.ui/pom.xml b/de.dlr.sc.virsat.apps.ui/pom.xml index 2fd0626299..56011a0883 100644 --- a/de.dlr.sc.virsat.apps.ui/pom.xml +++ b/de.dlr.sc.virsat.apps.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.apps/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.apps/META-INF/MANIFEST.MF index 543dac255c..e18be14f1b 100644 --- a/de.dlr.sc.virsat.apps/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.apps/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Apps Bundle-SymbolicName: de.dlr.sc.virsat.apps;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.apps.Activator Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/de.dlr.sc.virsat.apps/pom.xml b/de.dlr.sc.virsat.apps/pom.xml index 5095bc99f6..0b5668c9c3 100644 --- a/de.dlr.sc.virsat.apps/pom.xml +++ b/de.dlr.sc.virsat.apps/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.branding.feature/feature.xml b/de.dlr.sc.virsat.branding.feature/feature.xml index e759f244f9..ece4a78399 100644 --- a/de.dlr.sc.virsat.branding.feature/feature.xml +++ b/de.dlr.sc.virsat.branding.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.branding.feature/pom.xml b/de.dlr.sc.virsat.branding.feature/pom.xml index f55b038b19..e958322abf 100644 --- a/de.dlr.sc.virsat.branding.feature/pom.xml +++ b/de.dlr.sc.virsat.branding.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.branding.feature diff --git a/de.dlr.sc.virsat.branding.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.branding.ui/META-INF/MANIFEST.MF index 13725b21ca..3dc782ceca 100644 --- a/de.dlr.sc.virsat.branding.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.branding.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Branding UI Bundle-SymbolicName: de.dlr.sc.virsat.branding.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.branding.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/de.dlr.sc.virsat.branding.ui/plugin.xml b/de.dlr.sc.virsat.branding.ui/plugin.xml index 8b28b09044..c811cd54a8 100644 --- a/de.dlr.sc.virsat.branding.ui/plugin.xml +++ b/de.dlr.sc.virsat.branding.ui/plugin.xml @@ -26,7 +26,7 @@ + value="Virtual Satellite 4 - DVLM Core Version 4.12.1 © Copyright by DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e. V., German Aerospace Center) 2020. The DLR trade mark (as the word mark DLR or as combination DLR with the DLR Logo) is a registered and protected trade mark and may not be used without DLR´s prior written permission. Copyrighted content other than the S/W provided under the indicated Eclipse License Conditions such as images, photographs, videos and texts which are indicated as being under DLR´s copyright through copyright notice (i. g. © DLR 2020) are provided for use under the Terms of use as provided for on DLRs webpage www.dlr.de” German Aerospace Center (DLR) e.V. Lilienthalplatz 7 38108 Braunschweig Germany"> de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.build.feature/feature.xml b/de.dlr.sc.virsat.build.feature/feature.xml index 0112fb7ef7..9d0d3d7e3a 100644 --- a/de.dlr.sc.virsat.build.feature/feature.xml +++ b/de.dlr.sc.virsat.build.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.build.feature/pom.xml b/de.dlr.sc.virsat.build.feature/pom.xml index aabc324fda..5b0a3c28df 100644 --- a/de.dlr.sc.virsat.build.feature/pom.xml +++ b/de.dlr.sc.virsat.build.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.build.feature diff --git a/de.dlr.sc.virsat.build.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.build.test/META-INF/MANIFEST.MF index 02a0499ec6..5d252a677f 100644 --- a/de.dlr.sc.virsat.build.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.build.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Project Builder Tests Bundle-SymbolicName: de.dlr.sc.virsat.build.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.build Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.build.test/pom.xml b/de.dlr.sc.virsat.build.test/pom.xml index aa325089cb..a98e4aedcf 100644 --- a/de.dlr.sc.virsat.build.test/pom.xml +++ b/de.dlr.sc.virsat.build.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.build.test/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilderTest.java b/de.dlr.sc.virsat.build.test/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilderTest.java index 60896dccbf..f37f8c3c8a 100644 --- a/de.dlr.sc.virsat.build.test/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilderTest.java +++ b/de.dlr.sc.virsat.build.test/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilderTest.java @@ -104,9 +104,9 @@ protected IInheritanceCopier createInheritanceCopier() { protected boolean saveGotTriggered = false; @Override - protected void setSaveAfterIncrementalBuild() { + protected void triggerSaveAfterIncrementalBuild() { saveGotTriggered = true; - super.setSaveAfterIncrementalBuild(); + super.triggerSaveAfterIncrementalBuild(); } } diff --git a/de.dlr.sc.virsat.build.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.build.ui/META-INF/MANIFEST.MF index d80e6f03f2..bb0ea98cc2 100644 --- a/de.dlr.sc.virsat.build.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.build.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Project Builder UI Bundle-SymbolicName: de.dlr.sc.virsat.build.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.build.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.build;visibility:=reexport, diff --git a/de.dlr.sc.virsat.build.ui/pom.xml b/de.dlr.sc.virsat.build.ui/pom.xml index a9e1f04439..3972c3ac6f 100644 --- a/de.dlr.sc.virsat.build.ui/pom.xml +++ b/de.dlr.sc.virsat.build.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.build/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.build/META-INF/MANIFEST.MF index 1f51d4057e..3f54e1809c 100644 --- a/de.dlr.sc.virsat.build/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.build/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Project Builder Bundle-SymbolicName: de.dlr.sc.virsat.build;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.build.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.model, diff --git a/de.dlr.sc.virsat.build/pom.xml b/de.dlr.sc.virsat.build/pom.xml index 29227ac9fa..d64a5113c2 100644 --- a/de.dlr.sc.virsat.build/pom.xml +++ b/de.dlr.sc.virsat.build/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/AVirSatTransactionalBuilder.java b/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/AVirSatTransactionalBuilder.java index a14b646763..e781375c13 100644 --- a/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/AVirSatTransactionalBuilder.java +++ b/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/AVirSatTransactionalBuilder.java @@ -163,7 +163,7 @@ protected void transactionalFullBuildRemoveProblemMarkers() { protected void transactionalFullBuildUpdateProblemMarkers() { } - protected boolean saveAfterIncrementalBuild; + private boolean saveAfterIncrementalBuild; /** * Call this method during an incremental build to @@ -171,7 +171,7 @@ protected void transactionalFullBuildUpdateProblemMarkers() { * in case a SEI has been processed. It should not be called when other * files outside the dvlm mdoel have been processed by a builder. */ - protected void setSaveAfterIncrementalBuild() { + protected void triggerSaveAfterIncrementalBuild() { saveAfterIncrementalBuild = true; } diff --git a/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilder.java b/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilder.java index 7966bcdb39..924a28cbc0 100644 --- a/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilder.java +++ b/de.dlr.sc.virsat.build/src/de/dlr/sc/virsat/build/inheritance/VirSatInheritanceBuilder.java @@ -118,8 +118,6 @@ private Set getAllSeiInResource(Resource resource) { @Override protected void incrementalBuild(IResourceDelta delta, IProgressMonitor monitor) { - saveAfterIncrementalBuild = false; - Activator.getDefault().getLog().log(new Status(Status.INFO, Activator.getPluginId(), "VirSatInheritanceBuilder: Starting incremental build")); final int MAX_TASKS = 3; IInheritanceCopier inheritanceCopier = createInheritanceCopier(); @@ -163,7 +161,7 @@ public boolean visit(IResourceDelta delta) { // This is referring to the ticket #714 which raised an issue with resource properties in // a document CA. Adding a new file is triggering an incremental build but actually no DVLM // file is touched or changed. Finally the editor was set into an incorrect state. - setSaveAfterIncrementalBuild(); + triggerSaveAfterIncrementalBuild(); // Now call the incremental inheritance processing on the affected SEI final int SUB_TASKS = 100; diff --git a/de.dlr.sc.virsat.commons.feature/feature.xml b/de.dlr.sc.virsat.commons.feature/feature.xml index 004e9a0cf8..d2846a78f8 100644 --- a/de.dlr.sc.virsat.commons.feature/feature.xml +++ b/de.dlr.sc.virsat.commons.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.commons.feature/pom.xml b/de.dlr.sc.virsat.commons.feature/pom.xml index 127403914a..ed8f1f3003 100644 --- a/de.dlr.sc.virsat.commons.feature/pom.xml +++ b/de.dlr.sc.virsat.commons.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.commons.feature diff --git a/de.dlr.sc.virsat.commons.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.commons.test/META-INF/MANIFEST.MF index 7b0d4a1e35..b89ebef733 100644 --- a/de.dlr.sc.virsat.commons.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.commons.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Commons Tests Bundle-SymbolicName: de.dlr.sc.virsat.commons.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.commons Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.commons.test/pom.xml b/de.dlr.sc.virsat.commons.test/pom.xml index 8073007dce..73f53ef718 100644 --- a/de.dlr.sc.virsat.commons.test/pom.xml +++ b/de.dlr.sc.virsat.commons.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.commons.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.commons.ui/META-INF/MANIFEST.MF index 734c9d5a89..2c2299683c 100644 --- a/de.dlr.sc.virsat.commons.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.commons.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Commons UI Bundle-SymbolicName: de.dlr.sc.virsat.commons.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.core.expressions, diff --git a/de.dlr.sc.virsat.commons.ui/pom.xml b/de.dlr.sc.virsat.commons.ui/pom.xml index 39a930fbb9..fb9dcae6fa 100644 --- a/de.dlr.sc.virsat.commons.ui/pom.xml +++ b/de.dlr.sc.virsat.commons.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.commons/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.commons/META-INF/MANIFEST.MF index c0c445b2f5..f6e8a90e9a 100644 --- a/de.dlr.sc.virsat.commons/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.commons/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Commons Bundle-SymbolicName: de.dlr.sc.virsat.commons -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.commons.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.commons/pom.xml b/de.dlr.sc.virsat.commons/pom.xml index 90f8e5652b..650c500535 100644 --- a/de.dlr.sc.virsat.commons/pom.xml +++ b/de.dlr.sc.virsat.commons/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.concept.unittest.util/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.concept.unittest.util/META-INF/MANIFEST.MF index 2bc2584a62..9b5e7ed72f 100644 --- a/de.dlr.sc.virsat.concept.unittest.util/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.concept.unittest.util/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Concept Test Utils Bundle-SymbolicName: de.dlr.sc.virsat.concept.unittest.util -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.concept.unittest.util.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.concept.unittest.util/pom.xml b/de.dlr.sc.virsat.concept.unittest.util/pom.xml index 6269b09716..1a83b2756f 100644 --- a/de.dlr.sc.virsat.concept.unittest.util/pom.xml +++ b/de.dlr.sc.virsat.concept.unittest.util/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.dependencies.feature/feature.xml b/de.dlr.sc.virsat.dependencies.feature/feature.xml index e19bf1a944..7f6599d1f2 100644 --- a/de.dlr.sc.virsat.dependencies.feature/feature.xml +++ b/de.dlr.sc.virsat.dependencies.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.dependencies.feature/pom.xml b/de.dlr.sc.virsat.dependencies.feature/pom.xml index 322291a093..c5192fb2e9 100644 --- a/de.dlr.sc.virsat.dependencies.feature/pom.xml +++ b/de.dlr.sc.virsat.dependencies.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.dependencies.feature diff --git a/de.dlr.sc.virsat.docs.feature/docs/VirSat_Core_ReleaseNotes.txt b/de.dlr.sc.virsat.docs.feature/docs/VirSat_Core_ReleaseNotes.txt index 7527832e4d..1584095947 100644 --- a/de.dlr.sc.virsat.docs.feature/docs/VirSat_Core_ReleaseNotes.txt +++ b/de.dlr.sc.virsat.docs.feature/docs/VirSat_Core_ReleaseNotes.txt @@ -1,6 +1,28 @@ VirSat Core Release Notes ------------------------- +Release 4.12.1 (15th October 2020) +---------------------------------- + +New Features: + Updated OverTarget version to 1.2.1 - #722 Feature + Updated default QUDV units to contain units for thermal domain - #729 Feature + Improved Functional Electrical Architecture Excel exporter to include the full qualified name of interface ends - #739 Feature + Added support to also change the color of connection elements in diagrams - #750 Feature + Expanded requirements concept for basic verification modeling - #783 Feature + +Usability Updates: + Improved navigator to expand on drag and drop from concept palette - #31 Comfort/usability + Supporting F2 in the navigator for renaming and changing values - #775 Comfort/usability + +Fixed Bugs: + Fixed issue where editing references in tables showed wrong value - #86 Bug + Fixed issue where equations for integers saved the result as floating point values - #700 Bug + Fixed Excel exporter wizard throwing exceptions - #735 Bug + Fixed issue where the Functional Electrical Architecture diagram did not accept changes to the interface ordering - #749 Bug + Fixed Linux issue in Functional Electrical Architecture HTML exporter - #757 Bug + Fixed nullpointer exception when editing RequirementAttributes - #697 Bug + Release 4.12.0 (31th July 2020) ---------------------------------- diff --git a/de.dlr.sc.virsat.docs.feature/feature.xml b/de.dlr.sc.virsat.docs.feature/feature.xml index 09d1ff1fee..c2a9efac76 100644 --- a/de.dlr.sc.virsat.docs.feature/feature.xml +++ b/de.dlr.sc.virsat.docs.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.docs.feature/pom.xml b/de.dlr.sc.virsat.docs.feature/pom.xml index beb84ca432..b208f78169 100644 --- a/de.dlr.sc.virsat.docs.feature/pom.xml +++ b/de.dlr.sc.virsat.docs.feature/pom.xml @@ -14,7 +14,7 @@ ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.docs.feature diff --git a/de.dlr.sc.virsat.excel.feature/feature.xml b/de.dlr.sc.virsat.excel.feature/feature.xml index aa84dd739b..2048d92bfc 100644 --- a/de.dlr.sc.virsat.excel.feature/feature.xml +++ b/de.dlr.sc.virsat.excel.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.excel.feature/pom.xml b/de.dlr.sc.virsat.excel.feature/pom.xml index 80ce74cc64..2b8f51280a 100644 --- a/de.dlr.sc.virsat.excel.feature/pom.xml +++ b/de.dlr.sc.virsat.excel.feature/pom.xml @@ -14,7 +14,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.excel.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.excel.test/META-INF/MANIFEST.MF index d57a596aac..cf738d0a20 100644 --- a/de.dlr.sc.virsat.excel.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.excel.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Generic Excel IO Tests Bundle-SymbolicName: de.dlr.sc.virsat.excel.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.excel Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.excel.test/pom.xml b/de.dlr.sc.virsat.excel.test/pom.xml index 5d958eaef8..5d5aae9a0e 100644 --- a/de.dlr.sc.virsat.excel.test/pom.xml +++ b/de.dlr.sc.virsat.excel.test/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.excel.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.excel.ui/META-INF/MANIFEST.MF index 7fd4e51538..3159547b07 100644 --- a/de.dlr.sc.virsat.excel.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.excel.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Generic Excel IO UI Bundle-SymbolicName: de.dlr.sc.virsat.excel.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.excel.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.excel.ui/pom.xml b/de.dlr.sc.virsat.excel.ui/pom.xml index 28812a7cd6..e565eadf96 100644 --- a/de.dlr.sc.virsat.excel.ui/pom.xml +++ b/de.dlr.sc.virsat.excel.ui/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportPage.java b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportPage.java index 9c31b411af..51e04a8ee0 100644 --- a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportPage.java +++ b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportPage.java @@ -19,6 +19,8 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; @@ -59,7 +61,7 @@ public class ExportPage extends WizardPage { private static final int ROWS = 3; // Keys for the dialog settings - private static final String DESTINATION_FILE_KEY = "DESTINATION_FILE"; + public static final String DESTINATION_FILE_KEY = "DESTINATION_FILE"; private static final String USE_DEFAULT_TEMPLATE_KEY = "USE_DEFAULT_TEMPLATE"; private static final String DEFAULT_TEMPLATE_KEY = "DEFAULT_TEMPLATE"; private static final String DESCRIPTION = "Export the selected element to a folder"; @@ -129,7 +131,7 @@ public void createControl(Composite parent) { * @return true iff the page is complete */ public boolean isComplete() { - return destination && template; + return selection != null && destination && template; } /** @@ -161,15 +163,11 @@ private void handleSelectedCheckButton() { if (composite1.getVisible()) { template = true; } else { - if (templateField.getText().equals("")) { - template = false; - } else { - template = true; - } + template = !templateField.getText().equals(""); } composite1.setVisible(!composite1.getVisible()); - setPageComplete(selection != null && template && destination); + setPageComplete(isComplete()); } /** @@ -303,11 +301,24 @@ private void createFileDestinationUI() { final int widthHint = 250; data.widthHint = widthHint; destinationField.setLayoutData(data); - + destinationField.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + String selectedDirectoryName = destinationField.getText(); + if (selectedDirectoryName.equals("")) { + destination = false; + } else { + destination = true; + getDialogSettings().put(DESTINATION_FILE_KEY, selectedDirectoryName); + } + + setPageComplete(isComplete()); + } + }); + String defaultDestination = wizardSettings.get(DESTINATION_FILE_KEY); if (defaultDestination != null) { destinationField.setText(defaultDestination); - destination = true; } // destination browse button @@ -317,7 +328,6 @@ private void createFileDestinationUI() { @Override public void handleEvent(Event event) { - DirectoryDialog dialog = new DirectoryDialog(getContainer().getShell(), SWT.SAVE | SWT.SHEET); dialog.setText(DIALOG_TEXT); @@ -326,9 +336,6 @@ public void handleEvent(Event event) { if (selectedDirectoryName != null) { setErrorMessage(null); destinationField.setText(selectedDirectoryName); - destination = true; - wizardSettings.put(DESTINATION_FILE_KEY, selectedDirectoryName); - setPageComplete(isComplete()); } } }); diff --git a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportWizard.java b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportWizard.java index e63d4c702a..891dd8c216 100644 --- a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportWizard.java +++ b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ExportWizard.java @@ -85,6 +85,8 @@ public void init(IWorkbench workbench, IStructuredSelection selection) { public boolean performFinish() { // Grab the necessary context information String path = page.getDestination(); + getDialogSettings().put(ExportPage.DESTINATION_FILE_KEY, path); + EObject eObject = (EObject) page.getSelection(); // Do the actual exporting diff --git a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportPage.java b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportPage.java index 600f009db6..79227a2d0c 100644 --- a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportPage.java +++ b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportPage.java @@ -19,6 +19,8 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -58,7 +60,7 @@ public class ImportPage extends WizardPage { private static final int ROWS = 3; // Keys for the dialog settings - private static final String DESTINATION_FILE_KEY = "DESTINATION_FILE"; + public static final String DESTINATION_FILE_KEY = "DESTINATION_FILE"; private static final String DESCRIPTION = "Import the selected xlsx file and integrate data."; private static final String DESTINATION = "Select the import file:"; @@ -106,7 +108,7 @@ public void createControl(Composite parent) { * @return true iff the page is complete */ public boolean isComplete() { - return destination; + return selection != null && destination; } /** @@ -179,11 +181,24 @@ private void createFileDestinationUI() { final int widthHint = 250; data.widthHint = widthHint; destinationField.setLayoutData(data); + destinationField.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + String selectedDirectoryName = destinationField.getText(); + if (selectedDirectoryName.equals("")) { + destination = false; + } else { + destination = true; + getDialogSettings().put(DESTINATION_FILE_KEY, selectedDirectoryName); + } + + setPageComplete(isComplete()); + } + }); String defaultDestination = wizardSettings.get(DESTINATION_FILE_KEY); if (defaultDestination != null) { destinationField.setText(defaultDestination); - destination = true; } // destination browse button @@ -205,11 +220,8 @@ public void handleEvent(Event event) { String selectedDirectoryName = dialog.open(); if (selectedDirectoryName != null) { - destination = true; setErrorMessage(null); destinationField.setText(selectedDirectoryName); - wizardSettings.put(DESTINATION_FILE_KEY, selectedDirectoryName); - setPageComplete(isComplete()); } } }); diff --git a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportWizard.java b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportWizard.java index 7382742461..f0d03212f6 100644 --- a/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportWizard.java +++ b/de.dlr.sc.virsat.excel.ui/src/de/dlr/sc/virsat/excel/ui/wizards/ImportWizard.java @@ -92,6 +92,8 @@ public boolean performFinish() { // Read the file String path = page.getDestination(); + getDialogSettings().put(ImportPage.DESTINATION_FILE_KEY, path); + File file = new File(path); XSSFWorkbook wb = null; try { diff --git a/de.dlr.sc.virsat.excel/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.excel/META-INF/MANIFEST.MF index dd58eb5772..6ae19a4e10 100644 --- a/de.dlr.sc.virsat.excel/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.excel/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Generic Excel IO Bundle-SymbolicName: de.dlr.sc.virsat.excel;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.emf.ecore, org.eclipse.emf.ecore.xmi, diff --git a/de.dlr.sc.virsat.excel/pom.xml b/de.dlr.sc.virsat.excel/pom.xml index b7f196fe9a..fb5f10dcc5 100644 --- a/de.dlr.sc.virsat.excel/pom.xml +++ b/de.dlr.sc.virsat.excel/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/AExcelIo.java b/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/AExcelIo.java index 21ca318c04..dc021c09f1 100644 --- a/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/AExcelIo.java +++ b/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/AExcelIo.java @@ -15,9 +15,9 @@ */ public abstract class AExcelIo { - public static final int HEADER_ROW_STRUCTURALELEMENTUUID = 4; - public static final int HEADER_ROW_STRUCTURALELEMENTNAME = 5; - public static final int HEADER_ROW_STRUCTURALELEMENTTYPE = 6; + public static final int HEADER_ROW_STRUCTURALELEMENT_UUID = 4; + public static final int HEADER_ROW_STRUCTURALELEMENT_NAME = 5; + public static final int HEADER_ROW_STRUCTURALELEMENT_TYPE = 6; public static final int HEADER_ROW_USER = 7; public static final int HEADER_ROW_DATE = 8; public static final int HEADER_ROW_TIME = 9; @@ -27,10 +27,5 @@ public abstract class AExcelIo { public static final int COMMON_ROW_START_TABLE = 4; public static final String COMMON_DELETEMARK_VALUE = "1.0"; - public static final int INTERFACE_COLUMN_INTERFACE_TO = 4; - - public static final int INTERFACEEND_COLUMN_INTERFACEEND_NAME = 2; - public static final int INTERFACEEND_COLUMN_INTERFACEEND_TYPE = 3; - public static final String TEMPLATE_SHEETNAME_HEADER = "Header"; } diff --git a/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/exporter/ExcelExportHelper.java b/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/exporter/ExcelExportHelper.java index 09a1a4e790..012a77bb8a 100644 --- a/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/exporter/ExcelExportHelper.java +++ b/de.dlr.sc.virsat.excel/src/de/dlr/sc/virsat/excel/exporter/ExcelExportHelper.java @@ -108,13 +108,13 @@ public void writeHeaderSheet(StructuralElementInstance exportSei, LocalDateTime } // Just write the values, the property names should be in the header already - Row row = headerSheet.getRow(AExcelIo.HEADER_ROW_STRUCTURALELEMENTUUID); + Row row = headerSheet.getRow(AExcelIo.HEADER_ROW_STRUCTURALELEMENT_UUID); row.getCell(1).setCellValue(getCreationHelper().createRichTextString(exportSei.getUuid().toString())); - row = headerSheet.getRow(AExcelIo.HEADER_ROW_STRUCTURALELEMENTNAME); + row = headerSheet.getRow(AExcelIo.HEADER_ROW_STRUCTURALELEMENT_NAME); row.getCell(datacell).setCellValue(getCreationHelper().createRichTextString(exportSei.getName())); - row = headerSheet.getRow(AExcelIo.HEADER_ROW_STRUCTURALELEMENTTYPE); + row = headerSheet.getRow(AExcelIo.HEADER_ROW_STRUCTURALELEMENT_TYPE); row.getCell(datacell).setCellValue(getCreationHelper().createRichTextString(exportSei.getType().getName())); row = headerSheet.getRow(AExcelIo.HEADER_ROW_USER); diff --git a/de.dlr.sc.virsat.external.lib.apache.poi/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.apache.poi/META-INF/MANIFEST.MF index 5b8146084b..832d634c34 100644 --- a/de.dlr.sc.virsat.external.lib.apache.poi/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.apache.poi/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Apache POI Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.apache.poi -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Export-Package: org.apache.poi, org.apache.poi.common.usermodel, diff --git a/de.dlr.sc.virsat.external.lib.apache.poi/pom.xml b/de.dlr.sc.virsat.external.lib.apache.poi/pom.xml index c307b71669..965e596bfc 100644 --- a/de.dlr.sc.virsat.external.lib.apache.poi/pom.xml +++ b/de.dlr.sc.virsat.external.lib.apache.poi/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.commons.cli/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.commons.cli/META-INF/MANIFEST.MF index ca766c3526..cd8013c656 100644 --- a/de.dlr.sc.virsat.external.lib.commons.cli/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.commons.cli/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Apache Commons CLI Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.commons.cli;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.external.lib.commons.cli.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.external.lib diff --git a/de.dlr.sc.virsat.external.lib.commons.cli/pom.xml b/de.dlr.sc.virsat.external.lib.commons.cli/pom.xml index c3ee46ed31..6fb80830b5 100644 --- a/de.dlr.sc.virsat.external.lib.commons.cli/pom.xml +++ b/de.dlr.sc.virsat.external.lib.commons.cli/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.commons.csv/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.commons.csv/META-INF/MANIFEST.MF index ec3fe48587..452316f031 100644 --- a/de.dlr.sc.virsat.external.lib.commons.csv/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.commons.csv/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Apache Commons CSV Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.commons.csv;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Automatic-Module-Name: de.dlr.sc.virsat.external.lib.commons.csv Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.external.lib diff --git a/de.dlr.sc.virsat.external.lib.commons.csv/pom.xml b/de.dlr.sc.virsat.external.lib.commons.csv/pom.xml index 447955a01d..f3cff987db 100644 --- a/de.dlr.sc.virsat.external.lib.commons.csv/pom.xml +++ b/de.dlr.sc.virsat.external.lib.commons.csv/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.commons.math/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.commons.math/META-INF/MANIFEST.MF index d0656d31d4..7d96acd5c5 100644 --- a/de.dlr.sc.virsat.external.lib.commons.math/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.commons.math/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Apache Commons Math Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.commons.math;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.external.lib.commons.math.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.external.lib diff --git a/de.dlr.sc.virsat.external.lib.commons.math/pom.xml b/de.dlr.sc.virsat.external.lib.commons.math/pom.xml index ad4726a5db..a6c7462b8d 100644 --- a/de.dlr.sc.virsat.external.lib.commons.math/pom.xml +++ b/de.dlr.sc.virsat.external.lib.commons.math/pom.xml @@ -14,7 +14,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.feature/feature.xml b/de.dlr.sc.virsat.external.lib.feature/feature.xml index 52eac21ad4..77ee64bfc1 100644 --- a/de.dlr.sc.virsat.external.lib.feature/feature.xml +++ b/de.dlr.sc.virsat.external.lib.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.external.lib.feature/pom.xml b/de.dlr.sc.virsat.external.lib.feature/pom.xml index 0c7bb930ec..21afd09c54 100644 --- a/de.dlr.sc.virsat.external.lib.feature/pom.xml +++ b/de.dlr.sc.virsat.external.lib.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.external.lib.feature diff --git a/de.dlr.sc.virsat.external.lib.jersey/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.jersey/META-INF/MANIFEST.MF index 1e4c3ec4e3..8032154a05 100644 --- a/de.dlr.sc.virsat.external.lib.jersey/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.jersey/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Jersey Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.jersey -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ClassPath: ., externalLib/maven/aopalliance-repackaged.jar, diff --git a/de.dlr.sc.virsat.external.lib.jersey/pom.xml b/de.dlr.sc.virsat.external.lib.jersey/pom.xml index bcd949be6b..a8164aad7b 100644 --- a/de.dlr.sc.virsat.external.lib.jersey/pom.xml +++ b/de.dlr.sc.virsat.external.lib.jersey/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.jfreechart/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.jfreechart/META-INF/MANIFEST.MF index 92ad3c0cae..6ad827b33b 100644 --- a/de.dlr.sc.virsat.external.lib.jfreechart/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.jfreechart/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - JFreeChart Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.jfreechart;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.external.lib.jfreechart.Activator Require-Bundle: de.dlr.sc.virsat.external.lib, org.eclipse.swt, diff --git a/de.dlr.sc.virsat.external.lib.jfreechart/pom.xml b/de.dlr.sc.virsat.external.lib.jfreechart/pom.xml index 152da2957e..8a133c1966 100644 --- a/de.dlr.sc.virsat.external.lib.jfreechart/pom.xml +++ b/de.dlr.sc.virsat.external.lib.jfreechart/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.json-simple/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.json-simple/META-INF/MANIFEST.MF index affb0d4fd0..f6447f9818 100644 --- a/de.dlr.sc.virsat.external.lib.json-simple/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.json-simple/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - JSON Simple Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.json-simple -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ClassPath: ., externalLib/maven/json-simple.jar diff --git a/de.dlr.sc.virsat.external.lib.json-simple/pom.xml b/de.dlr.sc.virsat.external.lib.json-simple/pom.xml index ef9de83594..636e03187d 100644 --- a/de.dlr.sc.virsat.external.lib.json-simple/pom.xml +++ b/de.dlr.sc.virsat.external.lib.json-simple/pom.xml @@ -12,7 +12,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.matlabfile/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.matlabfile/META-INF/MANIFEST.MF index 09d70dda2e..fbbbd97acc 100644 --- a/de.dlr.sc.virsat.external.lib.matlabfile/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.matlabfile/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Matlabfile Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.matlabfile -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.external.lib.matlabfile.Activator Require-Bundle: de.dlr.sc.virsat.external.lib Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.external.lib.matlabfile/pom.xml b/de.dlr.sc.virsat.external.lib.matlabfile/pom.xml index 65d454051d..49c5a9f094 100644 --- a/de.dlr.sc.virsat.external.lib.matlabfile/pom.xml +++ b/de.dlr.sc.virsat.external.lib.matlabfile/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.external.lib.maven.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../de.dlr.sc.virsat.external.lib/maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib.nebula.incubation/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.nebula.incubation/META-INF/MANIFEST.MF index 163566d4b9..8c45840950 100644 --- a/de.dlr.sc.virsat.external.lib.nebula.incubation/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.nebula.incubation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Nebula Incubation Widgets Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.nebula.incubation;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.external.lib.nebula.incubation.Activator Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/de.dlr.sc.virsat.external.lib.nebula.incubation/pom.xml b/de.dlr.sc.virsat.external.lib.nebula.incubation/pom.xml index 1aec1fd2e0..1eea56d0c4 100644 --- a/de.dlr.sc.virsat.external.lib.nebula.incubation/pom.xml +++ b/de.dlr.sc.virsat.external.lib.nebula.incubation/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.external.lib.protobuf/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.protobuf/META-INF/MANIFEST.MF index b727274ce4..74c8ee64cf 100644 --- a/de.dlr.sc.virsat.external.lib.protobuf/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.protobuf/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Google Protobuf Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.protobuf -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ClassPath: ., externalLib/protobuf.jar diff --git a/de.dlr.sc.virsat.external.lib.protobuf/pom.xml b/de.dlr.sc.virsat.external.lib.protobuf/pom.xml index 1d6eea2ffe..a7b06f41f4 100644 --- a/de.dlr.sc.virsat.external.lib.protobuf/pom.xml +++ b/de.dlr.sc.virsat.external.lib.protobuf/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.external.lib.spotbugs/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.spotbugs/META-INF/MANIFEST.MF index cfc889c200..143a7ff053 100644 --- a/de.dlr.sc.virsat.external.lib.spotbugs/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.spotbugs/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Spotbugs Annotations Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.spotbugs -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ClassPath: ., externalLib/spotbugs-annotations-3.15/spotbugs-annotations-3.1.5.jar diff --git a/de.dlr.sc.virsat.external.lib.spotbugs/pom.xml b/de.dlr.sc.virsat.external.lib.spotbugs/pom.xml index 04a28882c0..beaac3e332 100644 --- a/de.dlr.sc.virsat.external.lib.spotbugs/pom.xml +++ b/de.dlr.sc.virsat.external.lib.spotbugs/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/META-INF/MANIFEST.MF index 6493f0550f..4c35d86c2d 100644 --- a/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Vtk Native Libraries for 64-Bit Linux Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.vtk.linux.x86_64;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Eclipse-PlatformFilter: (& (osgi.os=linux) (osgi.arch=x86_64) ) diff --git a/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/pom.xml b/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/pom.xml index 931405d7b7..d822a42797 100644 --- a/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/pom.xml +++ b/de.dlr.sc.virsat.external.lib.vtk.linux.x86_64/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 @@ -39,8 +39,8 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat de.dlr.sc.virsat.target - 4.12.0-SNAPSHOT - virsat + 4.12.1-SNAPSHOT + virsat_linux diff --git a/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/META-INF/MANIFEST.MF index 4437d04b3d..179619ba77 100644 --- a/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - Vtk Native Libraries for 64-Bit Win32 Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.vtk.win32.x86_64;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-NativeCode: native_lib/vtk/vtkalglib-8.1.dll; diff --git a/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/pom.xml b/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/pom.xml index eafbc0bcbc..5b5b7afa22 100644 --- a/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/pom.xml +++ b/de.dlr.sc.virsat.external.lib.vtk.win32.x86_64/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 @@ -40,8 +40,8 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat de.dlr.sc.virsat.target - 4.12.0-SNAPSHOT - virsat + 4.12.1-SNAPSHOT + virsat_windows diff --git a/de.dlr.sc.virsat.external.lib.z3/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.z3/META-INF/MANIFEST.MF index 4555b1884f..9413485478 100644 --- a/de.dlr.sc.virsat.external.lib.z3/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.z3/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Library Microsoft Z3 Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.z3;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.external.lib Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/de.dlr.sc.virsat.external.lib.z3/pom.xml b/de.dlr.sc.virsat.external.lib.z3/pom.xml index 5398b3a528..baea946755 100644 --- a/de.dlr.sc.virsat.external.lib.z3/pom.xml +++ b/de.dlr.sc.virsat.external.lib.z3/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/META-INF/MANIFEST.MF index 35218be435..f5974c9379 100644 --- a/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - JZMQ and ZeroMQ Native Libraries for 64-Bit Linux Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.zmq.linux.x86_64;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Eclipse-PlatformFilter: (& (osgi.os=linux) (osgi.arch=x86_64) ) diff --git a/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/pom.xml b/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/pom.xml index ca9e93450f..2468910117 100644 --- a/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/pom.xml +++ b/de.dlr.sc.virsat.external.lib.zmq.linux.x86_64/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 @@ -39,8 +39,8 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat de.dlr.sc.virsat.target - 4.12.0-SNAPSHOT - virsat + 4.12.1-SNAPSHOT + virsat_linux diff --git a/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/META-INF/MANIFEST.MF index 305cb2cf26..95b28df91d 100644 --- a/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - JZMQ and ZeroMQ Native Libraries for 64-Bit Win32 Bundle-SymbolicName: de.dlr.sc.virsat.external.lib.zmq.win32.x86_64;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-NativeCode: native_lib/zmq/jzmq.dll; diff --git a/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/pom.xml b/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/pom.xml index 417a813d58..12e55efcc1 100644 --- a/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/pom.xml +++ b/de.dlr.sc.virsat.external.lib.zmq.win32.x86_64/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 @@ -39,8 +39,8 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat de.dlr.sc.virsat.target - 4.12.0-SNAPSHOT - virsat + 4.12.1-SNAPSHOT + virsat_windows diff --git a/de.dlr.sc.virsat.external.lib/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.external.lib/META-INF/MANIFEST.MF index fc1ae2ccf0..d9b974b575 100644 --- a/de.dlr.sc.virsat.external.lib/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.external.lib/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat External Lib - General External Library Functionality Bundle-SymbolicName: de.dlr.sc.virsat.external.lib -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: org.eclipse.core.runtime;visibility:=reexport Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.external.lib/maven/pom.xml b/de.dlr.sc.virsat.external.lib/maven/pom.xml index 2aa418108e..5af25bae71 100644 --- a/de.dlr.sc.virsat.external.lib/maven/pom.xml +++ b/de.dlr.sc.virsat.external.lib/maven/pom.xml @@ -10,13 +10,13 @@ 4.0.0 de.dlr.sc.virsat de.dlr.sc.virsat.external.lib.maven.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT pom de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../../maven/pom.xml diff --git a/de.dlr.sc.virsat.external.lib/pom.xml b/de.dlr.sc.virsat.external.lib/pom.xml index 2cd62213d3..ec5714b7c6 100644 --- a/de.dlr.sc.virsat.external.lib/pom.xml +++ b/de.dlr.sc.virsat.external.lib/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.graphiti.feature/feature.xml b/de.dlr.sc.virsat.graphiti.feature/feature.xml index bda16b186d..2adef7bdfc 100644 --- a/de.dlr.sc.virsat.graphiti.feature/feature.xml +++ b/de.dlr.sc.virsat.graphiti.feature/feature.xml @@ -2,7 +2,7 @@ @@ -41,10 +41,10 @@ by German Aerospace Center (DLR e.V.) - - - - + + + + diff --git a/de.dlr.sc.virsat.graphiti.feature/pom.xml b/de.dlr.sc.virsat.graphiti.feature/pom.xml index ea89c2c687..0287d69027 100644 --- a/de.dlr.sc.virsat.graphiti.feature/pom.xml +++ b/de.dlr.sc.virsat.graphiti.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.graphiti.feature diff --git a/de.dlr.sc.virsat.graphiti.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.graphiti.test/META-INF/MANIFEST.MF index 8133475437..7fb910a16a 100644 --- a/de.dlr.sc.virsat.graphiti.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.graphiti.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Graphiti Tests Bundle-SymbolicName: de.dlr.sc.virsat.graphiti.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.graphiti Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.junit, diff --git a/de.dlr.sc.virsat.graphiti.test/pom.xml b/de.dlr.sc.virsat.graphiti.test/pom.xml index fbfedb7710..9c513d14ca 100644 --- a/de.dlr.sc.virsat.graphiti.test/pom.xml +++ b/de.dlr.sc.virsat.graphiti.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.graphiti.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.graphiti.ui/META-INF/MANIFEST.MF index 2a5db79138..f77671e8ce 100644 --- a/de.dlr.sc.virsat.graphiti.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.graphiti.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Graphiti Ui Bundle-SymbolicName: de.dlr.sc.virsat.graphiti.ui; singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.graphiti, de.dlr.sc.virsat.model.edit, de.dlr.sc.virsat.uiengine.ui, @@ -13,6 +13,7 @@ Require-Bundle: de.dlr.sc.virsat.graphiti, org.eclipse.ui.views.properties.tabbed;visibility:=reexport, org.eclipse.graphiti.ui;visibility:=reexport, org.eclipse.graphiti.mm, + org.eclipse.graphiti.pattern, org.eclipse.emf.workspace Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy diff --git a/de.dlr.sc.virsat.graphiti.ui/pom.xml b/de.dlr.sc.virsat.graphiti.ui/pom.xml index 95f554b88f..acecb3807b 100644 --- a/de.dlr.sc.virsat.graphiti.ui/pom.xml +++ b/de.dlr.sc.virsat.graphiti.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/editor/VirSatDiagramUpdateBehavior.java b/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/editor/VirSatDiagramUpdateBehavior.java index 4e2a59032b..81defe7e10 100644 --- a/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/editor/VirSatDiagramUpdateBehavior.java +++ b/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/editor/VirSatDiagramUpdateBehavior.java @@ -60,6 +60,7 @@ public class VirSatDiagramUpdateBehavior extends DefaultUpdateBehavior { return; } + updateContent(); diagramBehavior.refreshContent(); refreshDecorators(); break; @@ -85,6 +86,13 @@ public void run() { }); } + /** + * Override this method to do some automatic update every time there is a resource change. + */ + protected void updateContent() { + //no update by default + } + /** * React to resources getting closed by either handling the change or closing the editor * @param affectedResources the affected resources of some change diff --git a/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirSatChangeColorFeature.java b/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirSatChangeColorFeature.java index 6a4ded8877..be8a1326ed 100644 --- a/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirSatChangeColorFeature.java +++ b/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirSatChangeColorFeature.java @@ -15,6 +15,10 @@ import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; import org.eclipse.graphiti.mm.algorithms.Rectangle; import org.eclipse.graphiti.mm.algorithms.RoundedRectangle; +import org.eclipse.graphiti.mm.algorithms.Text; +import org.eclipse.graphiti.mm.algorithms.styles.Color; +import org.eclipse.graphiti.mm.pictograms.Connection; +import org.eclipse.graphiti.mm.pictograms.ConnectionDecorator; import org.eclipse.graphiti.mm.pictograms.PictogramElement; import org.eclipse.graphiti.util.ColorConstant; import org.eclipse.graphiti.util.IColorConstant; @@ -65,22 +69,53 @@ public void execute(ICustomContext context) { s.setLocation(context.getX(), context.getY()); ColorDialog colorDialog = new ColorDialog(s); RGB rgbColor = colorDialog.open(); - if (colorDialog != null && rgbColor != null) { - IColorConstant color = + if (rgbColor != null) { + IColorConstant colorConstant = new ColorConstant(rgbColor.red, rgbColor.green, rgbColor.blue); + Color color = manageColor(colorConstant); PictogramElement[] pes = context.getPictogramElements(); if (pes != null && pes.length == 1) { for (PictogramElement pe : pes) { - GraphicsAlgorithm ga = pe.getGraphicsAlgorithm(); - ga.setBackground(manageColor(color)); - for (GraphicsAlgorithm childGa : ga.getGraphicsAlgorithmChildren()) { - if (childGa instanceof RoundedRectangle || childGa instanceof Rectangle) { - childGa.setBackground(manageColor(color)); - } + if (pe instanceof Connection) { + changeConnectionColor((Connection) pe, color); + } else { + changeGenericPictogramElementColor(pe, color); } } } } } + + /** + * Changes the color of a generic pictorgram element + * @param pe the pictogram element + * @param color the target color + */ + private void changeGenericPictogramElementColor(PictogramElement pe, Color color) { + GraphicsAlgorithm ga = pe.getGraphicsAlgorithm(); + ga.setBackground(color); + for (GraphicsAlgorithm childGa : ga.getGraphicsAlgorithmChildren()) { + if (childGa instanceof RoundedRectangle || childGa instanceof Rectangle) { + childGa.setBackground(color); + } + } + } + + /** + * Changes the color of a connection + * @param connection the connection + * @param color the target color + */ + private void changeConnectionColor(Connection connection, Color color) { + GraphicsAlgorithm ga = connection.getGraphicsAlgorithm(); + // Connections & connection decorators use the foreground color to determine their color + ga.setForeground(color); + for (ConnectionDecorator connectionDecorator : connection.getConnectionDecorators()) { + GraphicsAlgorithm connectionDecoratorGa = connectionDecorator.getGraphicsAlgorithm(); + if (!(connectionDecoratorGa instanceof Text)) { + connectionDecoratorGa.setForeground(color); + } + } + } } diff --git a/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirsatDiagramFeatureProviderWithPatterns.java b/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirsatDiagramFeatureProviderWithPatterns.java new file mode 100644 index 0000000000..b17199bbb8 --- /dev/null +++ b/de.dlr.sc.virsat.graphiti.ui/src/de/dlr/sc/virsat/graphiti/ui/diagram/feature/VirsatDiagramFeatureProviderWithPatterns.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.graphiti.ui.diagram.feature; + +import org.eclipse.graphiti.dt.IDiagramTypeProvider; +import org.eclipse.graphiti.features.IAddBendpointFeature; +import org.eclipse.graphiti.features.IMoveBendpointFeature; +import org.eclipse.graphiti.features.context.IAddBendpointContext; +import org.eclipse.graphiti.features.context.IMoveBendpointContext; +import org.eclipse.graphiti.pattern.DefaultFeatureProviderWithPatterns; + +import de.dlr.sc.virsat.graphiti.diagram.BeanIndependenceSolver; + +public class VirsatDiagramFeatureProviderWithPatterns extends DefaultFeatureProviderWithPatterns { + + private BeanIndependenceSolver beanIndependenceSolver; + + public VirsatDiagramFeatureProviderWithPatterns(IDiagramTypeProvider dtp) { + super(dtp); + beanIndependenceSolver = new BeanIndependenceSolver(dtp); + setIndependenceSolver(beanIndependenceSolver); + } + + @Override + public IAddBendpointFeature getAddBendpointFeature(IAddBendpointContext context) { + return new VirSatAddBendpointFeature(this); + } + + @Override + public IMoveBendpointFeature getMoveBendpointFeature(IMoveBendpointContext context) { + return new VirSatMoveBendpointFeature(this); + } + + public BeanIndependenceSolver getBeanIndependenceSolver() { + return beanIndependenceSolver; + } + +} diff --git a/de.dlr.sc.virsat.graphiti/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.graphiti/META-INF/MANIFEST.MF index 512e31950e..10139d9481 100644 --- a/de.dlr.sc.virsat.graphiti/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.graphiti/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Graphiti Bundle-SymbolicName: de.dlr.sc.virsat.graphiti; singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: de.dlr.sc.virsat.model.edit, diff --git a/de.dlr.sc.virsat.graphiti/pom.xml b/de.dlr.sc.virsat.graphiti/pom.xml index dc92074d54..910a2544d1 100644 --- a/de.dlr.sc.virsat.graphiti/pom.xml +++ b/de.dlr.sc.virsat.graphiti/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.javadoc.api.feature/feature.xml b/de.dlr.sc.virsat.javadoc.api.feature/feature.xml index 1c0bf0581d..0f3a300ab2 100644 --- a/de.dlr.sc.virsat.javadoc.api.feature/feature.xml +++ b/de.dlr.sc.virsat.javadoc.api.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.javadoc.api.feature/pom.xml b/de.dlr.sc.virsat.javadoc.api.feature/pom.xml index 1bec45ea77..c8aac65633 100644 --- a/de.dlr.sc.virsat.javadoc.api.feature/pom.xml +++ b/de.dlr.sc.virsat.javadoc.api.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.javadoc.api.feature diff --git a/de.dlr.sc.virsat.javadoc.api/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.javadoc.api/META-INF/MANIFEST.MF index 27fe48fa0e..674c71fb5f 100644 --- a/de.dlr.sc.virsat.javadoc.api/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.javadoc.api/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Java Documentation for API Bundle-SymbolicName: de.dlr.sc.virsat.javadoc.api;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-ActivationPolicy: lazy diff --git a/de.dlr.sc.virsat.javadoc.api/pom.xml b/de.dlr.sc.virsat.javadoc.api/pom.xml index d3abd18432..bb1c1c1c46 100644 --- a/de.dlr.sc.virsat.javadoc.api/pom.xml +++ b/de.dlr.sc.virsat.javadoc.api/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.license.feature/feature.xml b/de.dlr.sc.virsat.license.feature/feature.xml index dcb04e1c4c..05b14f0164 100644 --- a/de.dlr.sc.virsat.license.feature/feature.xml +++ b/de.dlr.sc.virsat.license.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.license.feature/pom.xml b/de.dlr.sc.virsat.license.feature/pom.xml index f13d966282..73ffb36dc1 100644 --- a/de.dlr.sc.virsat.license.feature/pom.xml +++ b/de.dlr.sc.virsat.license.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.license.feature diff --git a/de.dlr.sc.virsat.model.calculation.feature/feature.xml b/de.dlr.sc.virsat.model.calculation.feature/feature.xml index 43ede9fc78..9b20fceb76 100644 --- a/de.dlr.sc.virsat.model.calculation.feature/feature.xml +++ b/de.dlr.sc.virsat.model.calculation.feature/feature.xml @@ -2,19 +2,19 @@ - VirSat Textual Calculations Feature -German Aerospace Center (DLR e.V.) + VirSat Textual Calculations Feature +German Aerospace Center (DLR e.V.) Simulation and Software Technology - Copyright 2015 + Copyright 2015 by German Aerospace Center (DLR e.V.) @@ -108,7 +108,7 @@ by German Aerospace Center (DLR e.V.) - + ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.calculation.feature diff --git a/de.dlr.sc.virsat.model.calculation.ide/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.calculation.ide/META-INF/MANIFEST.MF index a3951b481b..ed972ed5a5 100644 --- a/de.dlr.sc.virsat.model.calculation.ide/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.calculation.ide/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Calculation IDE Bundle-SymbolicName: de.dlr.sc.virsat.model.calculation.ide;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: de.dlr.sc.virsat.model.calculation, org.eclipse.xtext.ide, diff --git a/de.dlr.sc.virsat.model.calculation.ide/pom.xml b/de.dlr.sc.virsat.model.calculation.ide/pom.xml index 26f77bd7dd..7e70337564 100644 --- a/de.dlr.sc.virsat.model.calculation.ide/pom.xml +++ b/de.dlr.sc.virsat.model.calculation.ide/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.calculation.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.calculation.test/META-INF/MANIFEST.MF index 499fc09509..67f8d9f91d 100644 --- a/de.dlr.sc.virsat.model.calculation.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.calculation.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Calculation Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.calculation.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.calculation Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.calculation.test/pom.xml b/de.dlr.sc.virsat.model.calculation.test/pom.xml index f9dc4b507f..4324d569d6 100644 --- a/de.dlr.sc.virsat.model.calculation.test/pom.xml +++ b/de.dlr.sc.virsat.model.calculation.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/EquationHelperTest.java b/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/EquationHelperTest.java index 08f89ca000..7a8f21371b 100644 --- a/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/EquationHelperTest.java +++ b/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/EquationHelperTest.java @@ -34,6 +34,7 @@ import de.dlr.sc.virsat.model.dvlm.categories.CategoriesFactory; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.FloatProperty; import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.IntProperty; import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.PropertydefinitionsFactory; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; @@ -72,7 +73,7 @@ public void setUp() throws Exception { cat.setIsApplicableForAll(true); contents.add(cat); - IntProperty value = PropertydefinitionsFactory.eINSTANCE.createIntProperty(); + FloatProperty value = PropertydefinitionsFactory.eINSTANCE.createFloatProperty(); value.setName("value"); cat.getProperties().add(value); diff --git a/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/NumberLiteralSetterTest.java b/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/NumberLiteralSetterTest.java index efcd0b0efd..098bc72a60 100644 --- a/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/NumberLiteralSetterTest.java +++ b/de.dlr.sc.virsat.model.calculation.test/src/de/dlr/sc/virsat/model/calculation/compute/NumberLiteralSetterTest.java @@ -16,10 +16,16 @@ import org.junit.Test; +import de.dlr.sc.virsat.model.calculation.compute.extensions.NumberLiteralResult; import de.dlr.sc.virsat.model.calculation.compute.extensions.NumberLiteralSetter; import de.dlr.sc.virsat.model.calculation.compute.extensions.UnresolvedExpressionResult; import de.dlr.sc.virsat.model.calculation.compute.problem.EvaluationProblem; import de.dlr.sc.virsat.model.calculation.compute.problem.UnknownExpressionProblem; +import de.dlr.sc.virsat.model.dvlm.calculation.CalculationFactory; +import de.dlr.sc.virsat.model.dvlm.calculation.NumberLiteral; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.FloatProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.IntProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.PropertydefinitionsFactory; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesFactory; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; @@ -31,6 +37,45 @@ public class NumberLiteralSetterTest { + @Test + public void testSetDoubleExpressionResultOnFloatProperty() { + NumberLiteralSetter nls = new NumberLiteralSetter(); + + final String VALUE = "1.5"; + + NumberLiteral nl = CalculationFactory.eINSTANCE.createNumberLiteral(); + nl.setValue(VALUE); + NumberLiteralResult nlr = new NumberLiteralResult(nl); + ValuePropertyInstance vpi = PropertyinstancesFactory.eINSTANCE.createValuePropertyInstance(); + FloatProperty fp = PropertydefinitionsFactory.eINSTANCE.createFloatProperty(); + vpi.setType(fp); + + List problems = nls.set(vpi, nlr); + + assertTrue("No problems occurred during the set operation", problems.isEmpty()); + assertEquals("The value has been set correctly", VALUE, vpi.getValue()); + } + + @Test + public void testSetDoubleExpressionResultOnIntProperty() { + NumberLiteralSetter nls = new NumberLiteralSetter(); + + final String VALUE = "1.5"; + final String EXPECTED_VALUE = "1"; + + NumberLiteral nl = CalculationFactory.eINSTANCE.createNumberLiteral(); + nl.setValue(VALUE); + NumberLiteralResult nlr = new NumberLiteralResult(nl); + ValuePropertyInstance vpi = PropertyinstancesFactory.eINSTANCE.createValuePropertyInstance(); + IntProperty ip = PropertydefinitionsFactory.eINSTANCE.createIntProperty(); + vpi.setType(ip); + + List problems = nls.set(vpi, nlr); + + assertTrue("No problems occurred during the set operation", problems.isEmpty()); + assertEquals("The value has been set correctly", EXPECTED_VALUE, vpi.getValue()); + } + @Test public void testSetUnknownExpressionResult() { NumberLiteralSetter nls = new NumberLiteralSetter(); diff --git a/de.dlr.sc.virsat.model.calculation.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.calculation.ui/META-INF/MANIFEST.MF index ffd26534d7..8bfc6b3538 100644 --- a/de.dlr.sc.virsat.model.calculation.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.calculation.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Calculation UI Bundle-Vendor: DLR (German Aerospace Center) -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-SymbolicName: de.dlr.sc.virsat.model.calculation.ui; singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: de.dlr.sc.virsat.model, diff --git a/de.dlr.sc.virsat.model.calculation.ui/pom.xml b/de.dlr.sc.virsat.model.calculation.ui/pom.xml index 7079233f34..8f44b2c70f 100644 --- a/de.dlr.sc.virsat.model.calculation.ui/pom.xml +++ b/de.dlr.sc.virsat.model.calculation.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.calculation/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.calculation/META-INF/MANIFEST.MF index 5290b8b88d..3a98e5e51c 100644 --- a/de.dlr.sc.virsat.model.calculation/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.calculation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Calculation Bundle-Vendor: DLR (German Aerospace Center) -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-SymbolicName: de.dlr.sc.virsat.model.calculation; singleton:=true Bundle-ActivationPolicy: lazy Eclipse-ExtensibleAPI: true diff --git a/de.dlr.sc.virsat.model.calculation/pom.xml b/de.dlr.sc.virsat.model.calculation/pom.xml index 259432dcce..6222e5fe78 100644 --- a/de.dlr.sc.virsat.model.calculation/pom.xml +++ b/de.dlr.sc.virsat.model.calculation/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/IncrementalEquationBuilder.java b/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/IncrementalEquationBuilder.java index a9b8ad66fe..d0721bbe53 100644 --- a/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/IncrementalEquationBuilder.java +++ b/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/IncrementalEquationBuilder.java @@ -138,7 +138,7 @@ public boolean visit(IResourceDelta delta) throws CoreException { Resource resource = resourceSet.safeGetResource(iFile, false); // Were are actually processing files here so make sure the resources all get saved - setSaveAfterIncrementalBuild(); + triggerSaveAfterIncrementalBuild(); // In case the resource could not be loaded continue with the next delta. if (resource == null) { diff --git a/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/extensions/NumberLiteralSetter.java b/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/extensions/NumberLiteralSetter.java index bd5c14eded..a882f6427b 100644 --- a/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/extensions/NumberLiteralSetter.java +++ b/de.dlr.sc.virsat.model.calculation/src/de/dlr/sc/virsat/model/calculation/compute/extensions/NumberLiteralSetter.java @@ -22,7 +22,9 @@ import de.dlr.sc.virsat.model.calculation.compute.problem.UnknownExpressionProblem; import de.dlr.sc.virsat.model.dvlm.calculation.CalculationFactory; import de.dlr.sc.virsat.model.dvlm.calculation.NumberLiteral; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeDefinition; import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.IntProperty; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.qudv.AQuantityKind; @@ -58,7 +60,7 @@ public List set(ValuePropertyInstance instance, NumberLitera // Now check if this is not just a ValuePropertyInstance but also // a UnitValuePropertyInstance with an assigned unit. If so we need - // to convert the value + // to convert the value from the base unit to the unit of the instance if (instance instanceof UnitValuePropertyInstance) { AUnit targetUnit = ((UnitValuePropertyInstance) instance).getUnit(); @@ -79,7 +81,17 @@ public List set(ValuePropertyInstance instance, NumberLitera } } - instance.setValue(result.toString()); + ATypeDefinition type = instance.getType(); + if (type instanceof IntProperty) { + // Check if the target instance is a integer property and if so, cut off the fractionals + NumberLiteralHelper nlh = new NumberLiteralHelper(result.getNumberLiteral()); + int integerValue = (int) nlh.getValue(); + instance.setValue(String.valueOf(integerValue)); + } else { + // Otherwise we can directly set the value + instance.setValue(result.toString()); + } + return setProblems; } diff --git a/de.dlr.sc.virsat.model.concept.feature/aggregatePom/pom.xml b/de.dlr.sc.virsat.model.concept.feature/aggregatePom/pom.xml index 6356959baf..5f8f09e920 100644 --- a/de.dlr.sc.virsat.model.concept.feature/aggregatePom/pom.xml +++ b/de.dlr.sc.virsat.model.concept.feature/aggregatePom/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 4.0.0 de.dlr.sc.virsat.model.concept de.dlr.sc.virsat.model.concept.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT pom de.dlr.sc.virsat.model.concept.parent @@ -21,7 +21,7 @@ SPDX-License-Identifier: EPL-2.0 ../../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT diff --git a/de.dlr.sc.virsat.model.concept.feature/feature.xml b/de.dlr.sc.virsat.model.concept.feature/feature.xml index e7f6c8419a..fc79f531b2 100644 --- a/de.dlr.sc.virsat.model.concept.feature/feature.xml +++ b/de.dlr.sc.virsat.model.concept.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.concept.feature/pom.xml b/de.dlr.sc.virsat.model.concept.feature/pom.xml index 612e3caa4d..33884894b6 100644 --- a/de.dlr.sc.virsat.model.concept.feature/pom.xml +++ b/de.dlr.sc.virsat.model.concept.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.concept.feature diff --git a/de.dlr.sc.virsat.model.concept.ide/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.concept.ide/META-INF/MANIFEST.MF index 714ac664fc..681c92d449 100644 --- a/de.dlr.sc.virsat.model.concept.ide/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.concept.ide/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Concept IDE Tools IDE Bundle-SymbolicName: de.dlr.sc.virsat.model.concept.ide;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: de.dlr.sc.virsat.model.concept, org.eclipse.xtext.ide, diff --git a/de.dlr.sc.virsat.model.concept.ide/pom.xml b/de.dlr.sc.virsat.model.concept.ide/pom.xml index 4332db4f26..16bfb3a987 100644 --- a/de.dlr.sc.virsat.model.concept.ide/pom.xml +++ b/de.dlr.sc.virsat.model.concept.ide/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.concept.p2updatesite/category.xml b/de.dlr.sc.virsat.model.concept.p2updatesite/category.xml index 31a4208fd1..64b356fa6e 100644 --- a/de.dlr.sc.virsat.model.concept.p2updatesite/category.xml +++ b/de.dlr.sc.virsat.model.concept.p2updatesite/category.xml @@ -1,15 +1,15 @@ - + - + - + - + diff --git a/de.dlr.sc.virsat.model.concept.p2updatesite/pom.xml b/de.dlr.sc.virsat.model.concept.p2updatesite/pom.xml index b9687ba2fe..8a7ac5b0bf 100644 --- a/de.dlr.sc.virsat.model.concept.p2updatesite/pom.xml +++ b/de.dlr.sc.virsat.model.concept.p2updatesite/pom.xml @@ -15,7 +15,7 @@ ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.concept.p2updatesite diff --git a/de.dlr.sc.virsat.model.concept.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.concept.test/META-INF/MANIFEST.MF index e6ecc93022..5755857162 100644 --- a/de.dlr.sc.virsat.model.concept.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.concept.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Concept IDE Tools Bundle-Vendor: DLR (German Aerospace Center) -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.concept Bundle-SymbolicName: de.dlr.sc.virsat.model.concept.test;singleton:=true Bundle-ActivationPolicy: lazy diff --git a/de.dlr.sc.virsat.model.concept.test/pom.xml b/de.dlr.sc.virsat.model.concept.test/pom.xml index 9139059b67..11c61948bf 100644 --- a/de.dlr.sc.virsat.model.concept.test/pom.xml +++ b/de.dlr.sc.virsat.model.concept.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanEnumProperties.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanEnumProperties.java index 6aa1d59c40..68d3017f6c 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanEnumProperties.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanEnumProperties.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import org.eclipse.emf.common.command.Command; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryA extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.TestCategoryA"; @@ -112,6 +118,7 @@ public double getEnumPropertyEnum() { return enumProperty.getEnumValue(); } + @XmlElement public BeanPropertyEnum getEnumPropertyBean() { safeAccessEnumProperty(); return enumProperty; @@ -148,6 +155,7 @@ public double getEmptyEnumPropertyEnum() { return emptyEnumProperty.getEnumValue(); } + @XmlElement public BeanPropertyEnum getEmptyEnumPropertyBean() { safeAccessEmptyEnumProperty(); return emptyEnumProperty; @@ -155,4 +163,3 @@ public BeanPropertyEnum getEmptyEnumPropertyBean() { } - diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExtension.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExtension.java index f202bcdc4a..029d084fc4 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExtension.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExtension.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryB extends TestCategoryA implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.TestCategoryB"; @@ -68,4 +73,3 @@ public ATestCategoryB(CategoryAssignment categoryAssignement) { } - diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExternalEReference.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExternalEReference.java index 02c6bc13ec..7c24972435 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExternalEReference.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanExternalEReference.java @@ -12,16 +12,19 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEReference; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.external.tests.ExternalTestType; import de.dlr.sc.virsat.model.concept.list.TypeSafeEReferenceArrayInstanceList; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EReferencePropertyInstance; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; @@ -41,6 +44,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategory extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.TestCategory"; diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicArrayProperties.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicArrayProperties.java index aeda4cfd5e..16eb9b11ad 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicArrayProperties.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicArrayProperties.java @@ -12,21 +12,25 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.list.TypeSafeArrayInstanceList; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyBoolean; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyResource; +import javax.xml.bind.annotation.XmlElement; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyInt; @@ -42,6 +46,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategory extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.testCategory"; @@ -99,6 +105,7 @@ private void safeAccessTpSringArrayDynamicBean() { } } + @XmlElement public IBeanList getTpSringArrayDynamicBean() { safeAccessTpSringArrayDynamicBean(); return tpSringArrayDynamicBean; @@ -115,6 +122,7 @@ private void safeAccessTpSringArrayStaticBean() { } } + @XmlElement public IBeanList getTpSringArrayStaticBean() { safeAccessTpSringArrayStaticBean(); return tpSringArrayStaticBean; @@ -130,7 +138,8 @@ private void safeAccessTpIntArrayDynamicBean() { tpIntArrayDynamicBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("tpIntArrayDynamic")); } } - + + @XmlElement public IBeanList getTpIntArrayDynamicBean() { safeAccessTpIntArrayDynamicBean(); return tpIntArrayDynamicBean; @@ -146,7 +155,8 @@ private void safeAccessTpIntArrayStaticBean() { tpIntArrayStaticBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("tpIntArrayStatic")); } } - + + @XmlElement public IBeanList getTpIntArrayStaticBean() { safeAccessTpIntArrayStaticBean(); return tpIntArrayStaticBean; @@ -162,7 +172,8 @@ private void safeAccessTpFloatArrayDynamicBean() { tpFloatArrayDynamicBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("tpFloatArrayDynamic")); } } - + + @XmlElement public IBeanList getTpFloatArrayDynamicBean() { safeAccessTpFloatArrayDynamicBean(); return tpFloatArrayDynamicBean; @@ -178,7 +189,8 @@ private void safeAccessTpFloatArrayStaticBean() { tpFloatArrayStaticBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("tpFloatArrayStatic")); } } - + + @XmlElement public IBeanList getTpFloatArrayStaticBean() { safeAccessTpFloatArrayStaticBean(); return tpFloatArrayStaticBean; @@ -195,6 +207,7 @@ private void safeAccessTpBooleanArrayDynamicBean() { } } + @XmlElement public IBeanList getTpBooleanArrayDynamicBean() { safeAccessTpBooleanArrayDynamicBean(); return tpBooleanArrayDynamicBean; @@ -211,6 +224,7 @@ private void safeAccessTpBooleanArrayStaticBean() { } } + @XmlElement public IBeanList getTpBooleanArrayStaticBean() { safeAccessTpBooleanArrayStaticBean(); return tpBooleanArrayStaticBean; @@ -227,6 +241,7 @@ private void safeAccessTpResourceDynamichBean() { } } + @XmlElement public IBeanList getTpResourceDynamichBean() { safeAccessTpResourceDynamichBean(); return tpResourceDynamichBean; @@ -243,6 +258,7 @@ private void safeAccessTpResourceStaticBean() { } } + @XmlElement public IBeanList getTpResourceStaticBean() { safeAccessTpResourceStaticBean(); return tpResourceStaticBean; @@ -259,6 +275,7 @@ private void safeAccessTpEnumDynamichBean() { } } + @XmlElement public IBeanList getTpEnumDynamichBean() { safeAccessTpEnumDynamichBean(); return tpEnumDynamichBean; @@ -275,6 +292,7 @@ private void safeAccessTpEnumStaticBean() { } } + @XmlElement public IBeanList getTpEnumStaticBean() { safeAccessTpEnumStaticBean(); return tpEnumStaticBean; @@ -282,4 +300,3 @@ public IBeanList getTpEnumStaticBean() { } - diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicProperties.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicProperties.java index 1f678fea06..b9141390f1 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicProperties.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanIntrinsicProperties.java @@ -12,15 +12,18 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.util.URI; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ResourcePropertyInstance; import org.eclipse.emf.edit.domain.EditingDomain; @@ -31,6 +34,7 @@ import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyResource; +import javax.xml.bind.annotation.XmlElement; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyInt; @@ -46,6 +50,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategory extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.testCategory"; @@ -112,6 +118,7 @@ public String getTpSring() { return tpSring.getValue(); } + @XmlElement public BeanPropertyString getTpSringBean() { safeAccessTpSring(); return tpSring; @@ -148,6 +155,7 @@ public boolean isSetTpInt() { return tpInt.isSet(); } + @XmlElement public BeanPropertyInt getTpIntBean() { safeAccessTpInt(); return tpInt; @@ -184,6 +192,7 @@ public boolean isSetTpFloat() { return tpFloat.isSet(); } + @XmlElement public BeanPropertyFloat getTpFloatBean() { safeAccessTpFloat(); return tpFloat; @@ -215,6 +224,7 @@ public boolean getTpBoolean() { return tpBoolean.getValue(); } + @XmlElement public BeanPropertyBoolean getTpBooleanBean() { safeAccessTpBoolean(); return tpBoolean; @@ -246,6 +256,7 @@ public URI getTpResource() { return tpResource.getValue(); } + @XmlElement public BeanPropertyResource getTpResourceBean() { safeAccessTpResource(); return tpResource; @@ -282,6 +293,7 @@ public double getTpEnumEnum() { return tpEnum.getEnumValue(); } + @XmlElement public BeanPropertyEnum getTpEnumBean() { safeAccessTpEnum(); return tpEnum; @@ -289,4 +301,3 @@ public BeanPropertyEnum getTpEnumBean() { } - diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferences.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferences.java index 08bb414bbf..934a4200e8 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferences.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferences.java @@ -12,20 +12,26 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -40,6 +46,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryB extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.TestCategoryB"; @@ -89,6 +97,7 @@ private void safeAccessTestSubCategory() { } } + @XmlElement(nillable = true) public TestCategoryA getTestSubCategory() { safeAccessTestSubCategory(); return testSubCategory.getValue(); @@ -109,6 +118,8 @@ private void safeAccessTestRefCategory() { testRefCategory.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public TestCategoryA getTestRefCategory() { safeAccessTestRefCategory(); return testRefCategory.getValue(); @@ -139,6 +150,8 @@ private void safeAccessTestRefProperty() { testRefProperty.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public BeanPropertyString getTestRefProperty() { safeAccessTestRefProperty(); return testRefProperty.getValue(); diff --git a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferencesArrays.java b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferencesArrays.java index b8e1d4f716..79a2461a3c 100644 --- a/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferencesArrays.java +++ b/de.dlr.sc.virsat.model.concept.test/resources/expectedOutputFilesForGenerators/ACategoryBeanTypesAndReferencesArrays.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyBeanList; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; @@ -27,6 +30,7 @@ import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -41,6 +45,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryB extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "testConcept.TestCategoryB"; @@ -105,6 +111,7 @@ private void safeAccessTestSubCategoryArrayDynamicBean() { } } + @XmlElement public IBeanList> getTestSubCategoryArrayDynamicBean() { safeAccessTestSubCategoryArrayDynamicBean(); return testSubCategoryArrayDynamicBean; @@ -134,6 +141,7 @@ private void safeAccessTestSubCategoryArrayStaticBean() { } } + @XmlElement public IBeanList> getTestSubCategoryArrayStaticBean() { safeAccessTestSubCategoryArrayStaticBean(); return testSubCategoryArrayStaticBean; @@ -163,6 +171,7 @@ private void safeAccessTestRefCategoryArrayDynamicBean() { } } + @XmlElement public IBeanList> getTestRefCategoryArrayDynamicBean() { safeAccessTestRefCategoryArrayDynamicBean(); return testRefCategoryArrayDynamicBean; @@ -192,6 +201,7 @@ private void safeAccessTestRefCategoryArrayStaticBean() { } } + @XmlElement public IBeanList> getTestRefCategoryArrayStaticBean() { safeAccessTestRefCategoryArrayStaticBean(); return testRefCategoryArrayStaticBean; @@ -221,6 +231,7 @@ private void safeAccessTestRefPropertyArrayDynamicBean() { } } + @XmlElement public IBeanList> getTestRefPropertyArrayDynamicBean() { safeAccessTestRefPropertyArrayDynamicBean(); return testRefPropertyArrayDynamicBean; @@ -250,10 +261,11 @@ private void safeAccessTestRefPropertyArrayStaticBean() { } } + @XmlElement public IBeanList> getTestRefPropertyArrayStaticBean() { safeAccessTestRefPropertyArrayStaticBean(); return testRefPropertyArrayStaticBean; } + } - diff --git a/de.dlr.sc.virsat.model.concept.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.concept.ui/META-INF/MANIFEST.MF index c37a8c619a..1703727cf5 100644 --- a/de.dlr.sc.virsat.model.concept.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.concept.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Concept IDE Tools UI Bundle-Vendor: DLR (German Aerospace Center) -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-SymbolicName: de.dlr.sc.virsat.model.concept.ui; singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: de.dlr.sc.virsat.model.edit, diff --git a/de.dlr.sc.virsat.model.concept.ui/pom.xml b/de.dlr.sc.virsat.model.concept.ui/pom.xml index 875209eb7b..fe8b210053 100644 --- a/de.dlr.sc.virsat.model.concept.ui/pom.xml +++ b/de.dlr.sc.virsat.model.concept.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.concept/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.concept/META-INF/MANIFEST.MF index 713f3f8e66..54b790a257 100644 --- a/de.dlr.sc.virsat.model.concept/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.concept/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Bundle-Vendor: DLR (German Aerospace Center) -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-SymbolicName: de.dlr.sc.virsat.model.concept;singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: de.dlr.sc.virsat.model, diff --git a/de.dlr.sc.virsat.model.concept/pom.xml b/de.dlr.sc.virsat.model.concept/pom.xml index 59a2d86cfb..1520aeb787 100644 --- a/de.dlr.sc.virsat.model.concept/pom.xml +++ b/de.dlr.sc.virsat.model.concept/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.concept/src/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.xtend b/de.dlr.sc.virsat.model.concept/src/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.xtend index 1426c6a72a..e28171008a 100644 --- a/de.dlr.sc.virsat.model.concept/src/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.xtend +++ b/de.dlr.sc.virsat.model.concept/src/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.xtend @@ -78,6 +78,12 @@ import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyBeanList +import javax.xml.bind.annotation.XmlRootElement +import javax.xml.bind.annotation.XmlAccessorType +import javax.xml.bind.annotation.XmlAccessType +import javax.xml.bind.annotation.XmlElement +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter /** * This class is the generator for the category beans of our model extension. @@ -169,6 +175,11 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { // ***************************************************************** «ConceptGeneratorUtil.generateAClassHeader(category)» + «importManager.register(XmlRootElement)» + «importManager.register(XmlAccessorType)» + «importManager.register(XmlAccessType)» + @XmlRootElement + @XmlAccessorType(XmlAccessType.NONE) public abstract class A«category.name.toFirstUpper» extends «declareExtendedClass(category)» implements IBeanCategoryAssignment { «val fullQualifiedCategoryId = ActiveConceptHelper.getFullQualifiedId(category)» @@ -347,12 +358,14 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(BeanPropertyFloat); importManager.register(IBeanList); importManager.register(TypeSafeArrayInstanceList); + importManager.register(XmlElement); return ''' private IBeanList «property.name»Bean = new TypeSafeArrayInstanceList<>(BeanPropertyFloat.class); «declareSafeAccessArrayBeanMethod(property, importManager)» - + + @XmlElement public IBeanList «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -364,12 +377,14 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(BeanPropertyInt); importManager.register(IBeanList); importManager.register(TypeSafeArrayInstanceList); - + importManager.register(XmlElement); + return ''' private IBeanList «property.name»Bean = new TypeSafeArrayInstanceList<>(BeanPropertyInt.class); «declareSafeAccessArrayBeanMethod(property, importManager)» - + + @XmlElement public IBeanList «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -381,12 +396,14 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(BeanPropertyBoolean); importManager.register(IBeanList); importManager.register(TypeSafeArrayInstanceList); - + importManager.register(XmlElement); + return ''' private IBeanList «property.name»Bean = new TypeSafeArrayInstanceList<>(BeanPropertyBoolean.class); «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -398,12 +415,14 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(BeanPropertyString); importManager.register(IBeanList); importManager.register(TypeSafeArrayInstanceList); - + importManager.register(XmlElement); + return ''' private IBeanList «property.name»Bean = new TypeSafeArrayInstanceList<>(BeanPropertyString.class); «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -415,12 +434,14 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(BeanPropertyResource); importManager.register(IBeanList); importManager.register(TypeSafeArrayInstanceList); - + importManager.register(XmlElement); + return ''' private IBeanList «property.name»Bean = new TypeSafeArrayInstanceList<>(BeanPropertyResource.class); «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -432,12 +453,14 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(BeanPropertyEnum); importManager.register(IBeanList); importManager.register(TypeSafeArrayInstanceList); - + importManager.register(XmlElement); + return ''' private IBeanList «property.name»Bean = new TypeSafeArrayInstanceList<>(BeanPropertyEnum.class); «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -451,6 +474,8 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(TypeSafeComposedPropertyInstanceList) importManager.register(BeanPropertyComposed) importManager.register(TypeSafeComposedPropertyBeanList) + importManager.register(XmlElement); + return ''' private IBeanList<«property.type.name»> «property.name» = new TypeSafeComposedPropertyInstanceList<>(«property.type.name».class); @@ -465,6 +490,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList> «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -476,6 +502,8 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(IBeanList); importManager.register(BeanPropertyReference) importManager.register(TypeSafeReferencePropertyBeanList) + importManager.register(XmlElement); + if (property.referenceType instanceof Category) { importManager.register(property.referenceType) importManager.register(TypeSafeReferencePropertyInstanceList) @@ -494,6 +522,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList> «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -517,6 +546,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { «declareSafeAccessArrayBeanMethod(property, importManager)» + @XmlElement public IBeanList> «propertyMethodGetBean(property)»() { «propertyMethodSafeAccessBean(property)»; return «property.name»Bean; @@ -573,6 +603,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(Command); importManager.register(EditingDomain); importManager.register(UnitValuePropertyInstance); + importManager.register(XmlElement); return ''' private BeanPropertyFloat «property.name» = new BeanPropertyFloat(); @@ -599,6 +630,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { return «property.name».isSet(); } + @XmlElement public BeanPropertyFloat «propertyMethodGet(property)»Bean() { «propertyMethodSafeAccess(property)»; return «property.name»; @@ -611,6 +643,8 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(Command); importManager.register(EditingDomain); importManager.register(UnitValuePropertyInstance); + importManager.register(XmlElement); + return ''' private BeanPropertyInt «property.name» = new BeanPropertyInt(); @@ -636,6 +670,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { return «property.name».isSet(); } + @XmlElement public BeanPropertyInt «propertyMethodGet(property)»Bean() { «propertyMethodSafeAccess(property)»; return «property.name»; @@ -648,6 +683,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(Command); importManager.register(EditingDomain); importManager.register(ValuePropertyInstance); + importManager.register(XmlElement); return ''' private BeanPropertyBoolean «property.name» = new BeanPropertyBoolean(); @@ -669,6 +705,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { return «property.name».getValue(); } + @XmlElement public BeanPropertyBoolean «propertyMethodGet(property)»Bean() { «propertyMethodSafeAccess(property)»; return «property.name»; @@ -681,6 +718,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(Command); importManager.register(EditingDomain); importManager.register(ValuePropertyInstance); + importManager.register(XmlElement); return ''' private BeanPropertyString «property.name» = new BeanPropertyString(); @@ -702,6 +740,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { return «property.name».getValue(); } + @XmlElement public BeanPropertyString «propertyMethodGet(property)»Bean() { «propertyMethodSafeAccess(property)»; return «property.name»; @@ -715,6 +754,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(EditingDomain); importManager.register(ResourcePropertyInstance); importManager.register(URI); + importManager.register(XmlElement); return ''' private BeanPropertyResource «property.name» = new BeanPropertyResource(); @@ -736,6 +776,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { return «property.name».getValue(); } + @XmlElement public BeanPropertyResource «propertyMethodGet(property)»Bean() { «propertyMethodSafeAccess(property)»; return «property.name»; @@ -748,6 +789,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(Command); importManager.register(EditingDomain); importManager.register(EnumUnitPropertyInstance); + importManager.register(XmlElement); return ''' private BeanPropertyEnum «property.name» = new BeanPropertyEnum(); @@ -774,6 +816,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { return «property.name».getEnumValue(); } + @XmlElement public BeanPropertyEnum «propertyMethodGet(property)»Bean() { «propertyMethodSafeAccess(property)»; return «property.name»; @@ -785,6 +828,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { importManager.register(ComposedPropertyInstance); importManager.register(property.type); importManager.register(BeanPropertyComposed); + importManager.register(XmlElement); return ''' private BeanPropertyComposed<«property.type.name»> «property.name» = new BeanPropertyComposed<>(); @@ -796,6 +840,7 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { } } + @XmlElement(nillable = true) public «property.type.name» «propertyMethodGet(property)»() { «propertyMethodSafeAccess(property)»; return «property.name».getValue(); @@ -810,14 +855,18 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { override caseReferenceProperty(ReferenceProperty property) { - if (property.referenceType instanceof Category) { - importManager.register(ReferencePropertyInstance); - importManager.register(CategoryAssignment); - importManager.register(Command); - importManager.register(EditingDomain); - importManager.register(property.referenceType) - importManager.register(BeanPropertyReference); + importManager.register(ReferencePropertyInstance); + importManager.register(CategoryAssignment); + importManager.register(Command); + importManager.register(EditingDomain); + importManager.register(BeanPropertyReference); + importManager.register(ABeanObjectAdapter); + importManager.register(XmlJavaTypeAdapter); + importManager.register(XmlElement); + if (property.referenceType instanceof Category) { + importManager.register(property.referenceType); + return ''' private BeanPropertyReference<«property.referenceType.name»> «property.name» = new BeanPropertyReference<>(); @@ -826,6 +875,8 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { «property.name».setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public «property.referenceType.name» «propertyMethodGet(property)»() { «propertyMethodSafeAccess(property)»; return «property.name».getValue(); @@ -847,14 +898,10 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { } ''' } else { - importManager.register(ReferencePropertyInstance); - importManager.register(CategoryAssignment); - importManager.register(Command); - importManager.register(EditingDomain); var referencedProperty = property.referenceType as AProperty; var referencedPropertyType = getReferencePropertyType(referencedProperty); importManager.register(referencedPropertyType); - importManager.register(BeanPropertyReference); + return ''' private BeanPropertyReference<«referencedPropertyType.simpleName»> «property.name» = new BeanPropertyReference<>(); @@ -863,6 +910,8 @@ class GenerateCategoryBeans extends AGeneratorGapGenerator { «property.name».setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public «referencedPropertyType.simpleName» «propertyMethodGet(property)»() { «propertyMethodSafeAccess(property)»; return «property.name».getValue(); diff --git a/de.dlr.sc.virsat.model.concept/xtend-gen/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.java b/de.dlr.sc.virsat.model.concept/xtend-gen/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.java index f8377538fa..d21ade1e97 100644 --- a/de.dlr.sc.virsat.model.concept/xtend-gen/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.java +++ b/de.dlr.sc.virsat.model.concept/xtend-gen/de/dlr/sc/virsat/model/concept/generator/beans/GenerateCategoryBeans.java @@ -62,8 +62,14 @@ import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import java.util.Set; import java.util.function.Consumer; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; @@ -204,6 +210,16 @@ public CharSequence declareAClass(final Concept concept, final Category category CharSequence _generateAClassHeader = ConceptGeneratorUtil.generateAClassHeader(category); _builder.append(_generateAClassHeader); _builder.newLineIfNotEmpty(); + importManager.register(XmlRootElement.class); + _builder.newLineIfNotEmpty(); + importManager.register(XmlAccessorType.class); + _builder.newLineIfNotEmpty(); + importManager.register(XmlAccessType.class); + _builder.newLineIfNotEmpty(); + _builder.append("@XmlRootElement"); + _builder.newLine(); + _builder.append("@XmlAccessorType(XmlAccessType.NONE)"); + _builder.newLine(); _builder.append("public abstract class A"); String _firstUpper = StringExtensions.toFirstUpper(category.getName()); _builder.append(_firstUpper); @@ -666,6 +682,7 @@ public CharSequence caseFloatProperty(final FloatProperty property) { importManager.register(BeanPropertyFloat.class); importManager.register(IBeanList.class); importManager.register(TypeSafeArrayInstanceList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList "); String _name = property.getName(); @@ -676,7 +693,8 @@ public CharSequence caseFloatProperty(final FloatProperty property) { CharSequence _declareSafeAccessArrayBeanMethod = GenerateCategoryBeans.this.declareSafeAccessArrayBeanMethod(property, importManager); _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); - _builder.append("\t"); + _builder.newLine(); + _builder.append("@XmlElement"); _builder.newLine(); _builder.append("public IBeanList "); String _propertyMethodGetBean = GenerateCategoryBeans.this.propertyMethodGetBean(property); @@ -704,6 +722,7 @@ public CharSequence caseIntProperty(final IntProperty property) { importManager.register(BeanPropertyInt.class); importManager.register(IBeanList.class); importManager.register(TypeSafeArrayInstanceList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList "); String _name = property.getName(); @@ -714,7 +733,8 @@ public CharSequence caseIntProperty(final IntProperty property) { CharSequence _declareSafeAccessArrayBeanMethod = GenerateCategoryBeans.this.declareSafeAccessArrayBeanMethod(property, importManager); _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); - _builder.append("\t"); + _builder.newLine(); + _builder.append("@XmlElement"); _builder.newLine(); _builder.append("public IBeanList "); String _propertyMethodGetBean = GenerateCategoryBeans.this.propertyMethodGetBean(property); @@ -742,6 +762,7 @@ public CharSequence caseBooleanProperty(final BooleanProperty property) { importManager.register(BeanPropertyBoolean.class); importManager.register(IBeanList.class); importManager.register(TypeSafeArrayInstanceList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList "); String _name = property.getName(); @@ -753,6 +774,8 @@ public CharSequence caseBooleanProperty(final BooleanProperty property) { _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); _builder.newLine(); + _builder.append("@XmlElement"); + _builder.newLine(); _builder.append("public IBeanList "); String _propertyMethodGetBean = GenerateCategoryBeans.this.propertyMethodGetBean(property); _builder.append(_propertyMethodGetBean); @@ -779,6 +802,7 @@ public CharSequence caseStringProperty(final StringProperty property) { importManager.register(BeanPropertyString.class); importManager.register(IBeanList.class); importManager.register(TypeSafeArrayInstanceList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList "); String _name = property.getName(); @@ -790,6 +814,8 @@ public CharSequence caseStringProperty(final StringProperty property) { _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); _builder.newLine(); + _builder.append("@XmlElement"); + _builder.newLine(); _builder.append("public IBeanList "); String _propertyMethodGetBean = GenerateCategoryBeans.this.propertyMethodGetBean(property); _builder.append(_propertyMethodGetBean); @@ -816,6 +842,7 @@ public CharSequence caseResourceProperty(final ResourceProperty object) { importManager.register(BeanPropertyResource.class); importManager.register(IBeanList.class); importManager.register(TypeSafeArrayInstanceList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList "); String _name = property.getName(); @@ -827,6 +854,8 @@ public CharSequence caseResourceProperty(final ResourceProperty object) { _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); _builder.newLine(); + _builder.append("@XmlElement"); + _builder.newLine(); _builder.append("public IBeanList "); String _propertyMethodGetBean = GenerateCategoryBeans.this.propertyMethodGetBean(property); _builder.append(_propertyMethodGetBean); @@ -853,6 +882,7 @@ public CharSequence caseEnumProperty(final EnumProperty property) { importManager.register(BeanPropertyEnum.class); importManager.register(IBeanList.class); importManager.register(TypeSafeArrayInstanceList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList "); String _name = property.getName(); @@ -864,6 +894,8 @@ public CharSequence caseEnumProperty(final EnumProperty property) { _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); _builder.newLine(); + _builder.append("@XmlElement"); + _builder.newLine(); _builder.append("public IBeanList "); String _propertyMethodGetBean = GenerateCategoryBeans.this.propertyMethodGetBean(property); _builder.append(_propertyMethodGetBean); @@ -892,6 +924,7 @@ public CharSequence caseComposedProperty(final ComposedProperty property) { importManager.register(TypeSafeComposedPropertyInstanceList.class); importManager.register(BeanPropertyComposed.class); importManager.register(TypeSafeComposedPropertyBeanList.class); + importManager.register(XmlElement.class); StringConcatenation _builder = new StringConcatenation(); _builder.append("private IBeanList<"); String _name = property.getType().getName(); @@ -944,6 +977,8 @@ public CharSequence caseComposedProperty(final ComposedProperty property) { _builder.append(_declareSafeAccessArrayBeanMethod); _builder.newLineIfNotEmpty(); _builder.newLine(); + _builder.append("@XmlElement"); + _builder.newLine(); _builder.append("public IBeanList referencedPropertyType = GenerateCategoryBeans.getReferencePropertyType(referencedProperty); importManager.register(referencedPropertyType); - importManager.register(BeanPropertyReference.class); StringConcatenation _builder_1 = new StringConcatenation(); _builder_1.append("private BeanPropertyReference<"); String _simpleName = referencedPropertyType.getSimpleName(); @@ -2135,6 +2200,10 @@ public CharSequence caseReferenceProperty(final ReferenceProperty property) { _builder_1.append("}"); _builder_1.newLine(); _builder_1.newLine(); + _builder_1.append("@XmlElement(nillable = true)"); + _builder_1.newLine(); + _builder_1.append("@XmlJavaTypeAdapter(ABeanObjectAdapter.class)"); + _builder_1.newLine(); _builder_1.append("public "); String _simpleName_1 = referencedPropertyType.getSimpleName(); _builder_1.append(_simpleName_1); diff --git a/de.dlr.sc.virsat.model.edit.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.edit.test/META-INF/MANIFEST.MF index 66a16cd8d2..d3a299272a 100644 --- a/de.dlr.sc.virsat.model.edit.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.edit.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Data Model Edit Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.edit.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) Fragment-Host: de.dlr.sc.virsat.model.edit diff --git a/de.dlr.sc.virsat.model.edit.test/pom.xml b/de.dlr.sc.virsat.model.edit.test/pom.xml index 8602e0636f..e7a48baf15 100644 --- a/de.dlr.sc.virsat.model.edit.test/pom.xml +++ b/de.dlr.sc.virsat.model.edit.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/ABeanObjectAdapterTest.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/ABeanObjectAdapterTest.java new file mode 100644 index 0000000000..711295c350 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/ABeanObjectAdapterTest.java @@ -0,0 +1,89 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceImpl; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.concept.types.ABeanObject; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.PropertydefinitionsFactory; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; + +public class ABeanObjectAdapterTest { + + private ABeanObjectAdapter adapter; + private ValuePropertyInstance vpi; + private BeanPropertyString bean; + private static final VirSatUuid UUID = new VirSatUuid(); + + @Before + public void setUp() throws Exception { + ResourceSet resourceSet = new ResourceSetImpl(); + Resource resourceImpl = new ResourceImpl(); + resourceSet.getResources().add(resourceImpl); + + vpi = PropertyinstancesFactory.eINSTANCE.createValuePropertyInstance(); + vpi.setUuid(UUID); + vpi.setType(PropertydefinitionsFactory.eINSTANCE.createStringProperty()); + resourceImpl.getContents().add(vpi); + + bean = new BeanPropertyString(vpi); + + adapter = new ABeanObjectAdapter(resourceSet); + } + + @Test + public void testMarshalABeanObject() throws Exception { + String uuid = adapter.marshal(null); + assertNull("No bean returns null", uuid); + + uuid = adapter.marshal(bean); + assertEquals("The right uuid was returned", UUID.toString(), uuid); + + vpi.setUuid(null); + assertThrows("The type instance should have a uuid", + NullPointerException.class, () -> { + adapter.marshal(bean); + } + ); + } + + @Test + public void testUnmarshalString() throws Exception { + TypeInstanceAdapter adapterNoRs = new TypeInstanceAdapter(); + assertThrows("A resource set should be set", + NullPointerException.class, () -> { + adapterNoRs.unmarshal(null); + } + ); + + assertThrows("No mapping found", + IllegalArgumentException.class, () -> { + adapter.unmarshal(null); + } + ); + + @SuppressWarnings("rawtypes") + ABeanObject unmarshalledBean = adapter.unmarshal(UUID.toString()); + assertEquals("The right bean was returned", bean, (BeanPropertyString) unmarshalledBean); + } + +} diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/AnyTypeAdapterTest.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/AnyTypeAdapterTest.java new file mode 100644 index 0000000000..14373c4358 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/AnyTypeAdapterTest.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.Test; + +public class AnyTypeAdapterTest { + + private AnyTypeAdapter adapter; + private Object testObject; + + @Before + public void setUp() throws Exception { + adapter = new AnyTypeAdapter(); + testObject = new Object(); + } + + @Test + public void testUnmarshalObject() throws Exception { + Object marshalledObject = adapter.marshal(testObject); + assertEquals(testObject, marshalledObject); + } + + @Test + public void testMarshalObject() throws Exception { + Object unmarshalledObject = adapter.unmarshal(testObject); + assertEquals(testObject, unmarshalledObject); + } + +} diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/DoubleAdapterTest.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/DoubleAdapterTest.java new file mode 100644 index 0000000000..f8f5ab1370 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/DoubleAdapterTest.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import static org.junit.Assert.assertEquals; + +import org.junit.Before; +import org.junit.Test; + +public class DoubleAdapterTest { + + private DoubleAdapter adapter; + private Double testDouble; + + @Before + public void setUp() throws Exception { + adapter = new DoubleAdapter(); + testDouble = Double.NaN; + } + + @Test + public void testUnmarshalDouble() throws Exception { + Double unmarshalledDouble = adapter.unmarshal(testDouble); + assertEquals(testDouble, unmarshalledDouble); + } + + @Test + public void testMarshalDouble() throws Exception { + Double marshalledDouble = adapter.marshal(testDouble); + assertEquals(null, marshalledDouble); + + testDouble = 0.0; + marshalledDouble = adapter.marshal(testDouble); + assertEquals(testDouble, marshalledDouble); + } + +} diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/JAXBUtilityTest.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/JAXBUtilityTest.java new file mode 100644 index 0000000000..7115f96ec3 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/JAXBUtilityTest.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; + +import org.junit.Before; +import org.junit.Test; + +public class JAXBUtilityTest { + + private JAXBUtility jaxbUtility; + @SuppressWarnings("rawtypes") + private static final Class[] REGISTER_CLASSES = new Class[] { Object.class }; + + @Before + public void setUp() throws Exception { + jaxbUtility = new JAXBUtility(); + } + + private void assertIsInitialized() { + assertEquals("System property set", JAXBUtility.CLASSPATH_JAXB_CONTEXT_FACTORY, + System.getProperty(JAXBUtility.SYSTEM_PROP_CONTEXT_FACTORY)); + + assertEquals("Two properties set", 2, jaxbUtility.getProperties().size()); + } + + @Test + public void testEmptyConstructor() { + assertIsInitialized(); + } + + @Test + public void testConstructor() throws JAXBException { + jaxbUtility = new JAXBUtility(REGISTER_CLASSES); + + assertNotNull(jaxbUtility.getContext()); + assertIsInitialized(); + } + + @Test + public void testCreateContext() throws JAXBException { + assertThrows(IllegalArgumentException.class, () -> { + jaxbUtility.createContext(null); + }); + + JAXBContext context = jaxbUtility.createContext(new Class[] {}); + assertNotNull(context); + + context = jaxbUtility.createContext(REGISTER_CLASSES); + assertNotNull(context); + } + + @Test + public void testGetJsonMarshaller() throws JAXBException { + assertNull(jaxbUtility.getJsonMarshaller()); + + jaxbUtility.createContext(REGISTER_CLASSES); + Marshaller marshaller = jaxbUtility.getJsonMarshaller(); + assertNotNull(marshaller); + assertNotNull(marshaller.getEventHandler()); + assertEquals(true, marshaller.getProperty(Marshaller.JAXB_FORMATTED_OUTPUT)); + } + + @Test + public void testGetJsonUnmarshaller() throws JAXBException { + assertNull(jaxbUtility.getJsonUnmarshaller(null)); + + jaxbUtility.createContext(REGISTER_CLASSES); + Unmarshaller unmarshaller = jaxbUtility.getJsonUnmarshaller(null); + assertNotNull(unmarshaller); + assertNotNull(unmarshaller.getEventHandler()); + + assertNotNull("Adapter is set", unmarshaller.getAdapter(TypeInstanceAdapter.class)); + assertNotNull("Adapter is set", unmarshaller.getAdapter(ABeanObjectAdapter.class)); + } + +} diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/TypeInstanceAdapterTest.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/TypeInstanceAdapterTest.java new file mode 100644 index 0000000000..9b8f23f0e0 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/TypeInstanceAdapterTest.java @@ -0,0 +1,84 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceImpl; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; + +public class TypeInstanceAdapterTest { + + private TypeInstanceAdapter adapter; + private ValuePropertyInstance vpi; + private static final VirSatUuid UUID = new VirSatUuid(); + + @Before + public void setUp() throws Exception { + ResourceSet resourceSet = new ResourceSetImpl(); + Resource resourceImpl = new ResourceImpl(); + resourceSet.getResources().add(resourceImpl); + + vpi = PropertyinstancesFactory.eINSTANCE.createValuePropertyInstance(); + vpi.setUuid(UUID); + resourceImpl.getContents().add(vpi); + + adapter = new TypeInstanceAdapter(resourceSet); + } + + @Test + public void testMarshalATypeInstance() throws Exception { + assertThrows("The type instance should not be null", + NullPointerException.class, () -> { + adapter.marshal(null); + } + ); + + String uuid = adapter.marshal(vpi); + assertEquals("The right uuid was returned", UUID.toString(), uuid); + + vpi.setUuid(null); + assertThrows("The type instance should have a uuid", + NullPointerException.class, () -> { + adapter.marshal(vpi); + } + ); + } + + @Test + public void testUnmarshalString() throws Exception { + TypeInstanceAdapter adapterNoRs = new TypeInstanceAdapter(); + assertThrows("A resource set should be set", + NullPointerException.class, () -> { + adapterNoRs.unmarshal(null); + } + ); + + assertThrows("No mapping found", + IllegalArgumentException.class, () -> { + adapter.unmarshal(null); + } + ); + + ATypeInstance unmarshalledTi = adapter.unmarshal(UUID.toString()); + assertEquals("The right vpi was returned", vpi, (ValuePropertyInstance) unmarshalledTi); + } + +} diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/UriAdapterTest.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/UriAdapterTest.java new file mode 100644 index 0000000000..3d77e1d1b5 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/dvlm/json/UriAdapterTest.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.eclipse.emf.common.util.URI; +import org.junit.Before; +import org.junit.Test; + +public class UriAdapterTest { + + private UriAdapter adapter; + private URI testUri; + private static final String TEST_RESOURCE = "resources/file[1].xls"; + private static final String TEST_RESOURCE_STRING = "/" + TEST_RESOURCE; + + @Before + public void setUp() throws Exception { + adapter = new UriAdapter(); + testUri = URI.createPlatformPluginURI(TEST_RESOURCE, false); + } + + @Test + public void testUnmarshalString() throws Exception { + URI unmarshalledUri = adapter.unmarshal(null); + assertNull(unmarshalledUri); + + unmarshalledUri = adapter.unmarshal(TEST_RESOURCE); + assertEquals(testUri, unmarshalledUri); + } + + @Test + public void testMarshalURI() throws Exception { + String marshalledUriString = adapter.marshal(null); + assertNull(marshalledUriString); + + marshalledUriString = adapter.marshal(testUri); + assertEquals(TEST_RESOURCE_STRING, marshalledUriString); + } + +} diff --git a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/edit/test/AllTests.java b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/edit/test/AllTests.java index 85d5c6364f..505b2740cf 100644 --- a/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/edit/test/AllTests.java +++ b/de.dlr.sc.virsat.model.edit.test/src/de/dlr/sc/virsat/model/edit/test/AllTests.java @@ -50,6 +50,12 @@ import de.dlr.sc.virsat.model.dvlm.command.SetValuePropertyInstanceCommandTest; import de.dlr.sc.virsat.model.dvlm.command.UndoableAddCommandTest; import de.dlr.sc.virsat.model.dvlm.concepts.registry.ActiveConceptConfigurationElementTest; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapterTest; +import de.dlr.sc.virsat.model.dvlm.json.AnyTypeAdapterTest; +import de.dlr.sc.virsat.model.dvlm.json.DoubleAdapterTest; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtilityTest; +import de.dlr.sc.virsat.model.dvlm.json.TypeInstanceAdapterTest; +import de.dlr.sc.virsat.model.dvlm.json.UriAdapterTest; import de.dlr.sc.virsat.model.dvlm.provider.DVLMRepositoryItemProviderTest; import de.dlr.sc.virsat.model.dvlm.qudv.provider.DVLMQudvItemProviderAdapterFactoryTest; import de.dlr.sc.virsat.model.dvlm.qudv.provider.DVLMSystemOfQuantitiesItemProviderTest; @@ -128,7 +134,13 @@ PropertyInstanceHelperTest.class, TypeSafeEReferenceArrayInstanceListTest.class, TypeSafeReferencePropertyBeanListTest.class, - TypeSafeComposedPropertyBeanListTest.class + TypeSafeComposedPropertyBeanListTest.class, + ABeanObjectAdapterTest.class, + AnyTypeAdapterTest.class, + DoubleAdapterTest.class, + JAXBUtilityTest.class, + TypeInstanceAdapterTest.class, + UriAdapterTest.class, }) /** diff --git a/de.dlr.sc.virsat.model.edit/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.edit/META-INF/MANIFEST.MF index 56f590531b..fff5831890 100644 --- a/de.dlr.sc.virsat.model.edit/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.edit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model.edit;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Activator: de.dlr.sc.virsat.model.dvlm.provider.DVLMEditPlugin$Implementation Bundle-Vendor: %providerName @@ -29,6 +29,7 @@ Export-Package: de.dlr.sc.virsat.model.concept.list, de.dlr.sc.virsat.model.dvlm.command, de.dlr.sc.virsat.model.dvlm.concepts.provider, de.dlr.sc.virsat.model.dvlm.concepts.registry, + de.dlr.sc.virsat.model.dvlm.json, de.dlr.sc.virsat.model.dvlm.dmf.provider, de.dlr.sc.virsat.model.dvlm.general.provider, de.dlr.sc.virsat.model.dvlm.inheritance.provider, @@ -62,3 +63,4 @@ Require-Bundle: org.eclipse.osgi, de.dlr.sc.virsat.external.lib.matlabfile Bundle-ActivationPolicy: lazy Automatic-Module-Name: de.dlr.sc.virsat.model.edit +Import-Package: org.eclipse.persistence.jaxb diff --git a/de.dlr.sc.virsat.model.edit/pom.xml b/de.dlr.sc.virsat.model.edit/pom.xml index 0c452e5f5e..7c65f5a811 100644 --- a/de.dlr.sc.virsat.model.edit/pom.xml +++ b/de.dlr.sc.virsat.model.edit/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/list/TypeSafeArrayInstanceList.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/list/TypeSafeArrayInstanceList.java index 5ee4d6c7ca..79f7c3831f 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/list/TypeSafeArrayInstanceList.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/list/TypeSafeArrayInstanceList.java @@ -14,6 +14,7 @@ import java.util.List; import de.dlr.sc.virsat.model.concept.types.property.IBeanProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.StaticArrayModifier; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.APropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; @@ -191,14 +192,62 @@ public BEAN_TYPE get(int index) { return bean; } + /** + * Custom handling for static lists: + * Checks if the current element at the index has the same UUID as the new one + * If that is the case it gets set, else an UnsupportedOperationException is thrown + */ @Override public BEAN_TYPE set(int index, BEAN_TYPE element) { - super.set(index, element); BEAN_TYPE oldBean = get(index); + + if (arrayModifier instanceof StaticArrayModifier) { + if (!element.getUuid().equals(oldBean.getUuid())) { + throw new UnsupportedOperationException(); + } + } + ai.getArrayInstances().set(index, element.getTypeInstance()); return oldBean; } + /** + * Custom handling for static lists: + * Checks if an element with the same UUID exists in the list + * If that is the case the set method is called, + * else an UnsupportedOperationException is thrown + */ + @Override + public boolean add(BEAN_TYPE e) { + if (arrayModifier instanceof StaticArrayModifier) { + int index = getIndexByUUID(e); + + if (index > -1) { + set(index, e); + return true; + } else { + throw new UnsupportedOperationException(); + } + } else { + return super.add(e); + } + } + + /** + * Get the index of the element by it's UUID + * @param e element + * @return the index or -1 if not found + */ + private int getIndexByUUID(BEAN_TYPE e) { + for (int i = 0; i < ai.getArrayInstances().size(); i++) { + BEAN_TYPE bean = get(i); + if (e.getUuid().equals(bean.getUuid())) { + return i; + } + } + return -1; + } + @Override public void add(int index, BEAN_TYPE element) { super.add(index, element); diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/migrator/AMigrator.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/migrator/AMigrator.java index d169a9469c..96dd6f4443 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/migrator/AMigrator.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/migrator/AMigrator.java @@ -179,11 +179,17 @@ private void setupMergeRegistry() { final IMerger referenceMerger = new ReferenceChangeMerger() { @Override protected void removeFromTarget(ReferenceChange diff, boolean rightToLeft) { - Comparison comparison = diff.getMatch().getComparison(); + Comparison comparison = diff.getMatch().getComparison(); Match valueMatch = comparison.getMatch(diff.getValue()); - EObject right = valueMatch.getRight(); - super.removeFromTarget(diff, rightToLeft); - valueMatch.setRight(right); + + // Add null check to prevent exceptions caused by test setup - loaded concepts are loaded isolated from each + // other, so references to other concepts cannot be resolved + if (valueMatch != null) { + // Saving the match for later to be able to do custom migration and data model migration + EObject right = valueMatch.getRight(); + super.removeFromTarget(diff, rightToLeft); + valueMatch.setRight(right); + } } @Override diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/ABeanObject.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/ABeanObject.java index 0d098fd8e9..983a1e66fa 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/ABeanObject.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/ABeanObject.java @@ -9,8 +9,16 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.json.TypeInstanceAdapter; /** * Core functionality for a Concept Bean and abstract implementation to the interface @@ -18,6 +26,8 @@ * *@param */ +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement public abstract class ABeanObject implements IBeanObject { protected CP_TYPE ti; @@ -44,6 +54,9 @@ public void setATypeInstance(ATypeInstance ti) { this.ti = (CP_TYPE) ti; } + @XmlID + @XmlElement(name = "uuid") + @XmlJavaTypeAdapter(TypeInstanceAdapter.class) @Override public ATypeInstance getATypeInstance() { return ti; @@ -58,7 +71,7 @@ public void setTypeInstance(CP_TYPE ti) { public CP_TYPE getTypeInstance() { return ti; } - + @Override public String getUuid() { return ti.getUuid().toString(); diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/category/ABeanCategoryAssignment.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/category/ABeanCategoryAssignment.java index 4e71067df3..a6a74f286b 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/category/ABeanCategoryAssignment.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/category/ABeanCategoryAssignment.java @@ -9,6 +9,8 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.category; +import javax.xml.bind.annotation.XmlElement; + import org.eclipse.core.runtime.CoreException; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.ecore.util.EcoreUtil; @@ -150,6 +152,7 @@ public int hashCode() { } @Override + @XmlElement(nillable = true) public String getName() { return ti.getName(); } diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/factory/BeanTypeInstanceFactory.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/factory/BeanTypeInstanceFactory.java new file mode 100644 index 0000000000..5eaf13da48 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/factory/BeanTypeInstanceFactory.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.concept.types.factory; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.Status; + +import de.dlr.sc.virsat.model.concept.types.IBeanObject; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.APropertyInstance; +import de.dlr.sc.virsat.model.dvlm.provider.DVLMEditPlugin; + +/** + * A factory class for TypeInstanceBeans which can create the correct bean + * for a given ATypeInstance depending on the registration of Beans + */ +public class BeanTypeInstanceFactory { + + private BeanCategoryAssignmentFactory beanCategoryAssignmentFactory; + private BeanPropertyFactory beanPropertyFactory; + + public BeanTypeInstanceFactory() { + beanCategoryAssignmentFactory = new BeanCategoryAssignmentFactory(); + beanPropertyFactory = new BeanPropertyFactory(); + } + + /** + * Call this method to create the correct Bean for a given ATypeInstance. This + * method will also set the Beans internal TypeInstance accordingly. + * @param typeInstance The ATypeInstance for which to create a Bean + * @return the Bean for the given ATypeInstance with the TypeInstance being correctly set + * @throws CoreException An exception if a Bean could not be created + */ + public IBeanObject getInstanceFor(ATypeInstance typeInstance) throws CoreException { + // Return the correct category assignment or property instance bean + if (typeInstance instanceof CategoryAssignment) { + return beanCategoryAssignmentFactory.getInstanceFor((CategoryAssignment) typeInstance); + } else if (typeInstance instanceof APropertyInstance) { + return beanPropertyFactory.getInstanceFor((APropertyInstance) typeInstance); + } else { + throw new CoreException(new Status( + Status.ERROR, + DVLMEditPlugin.PLUGIN_ID, + "Could not create bean for " + typeInstance.getFullQualifiedInstanceName())); + } + } +} diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/ABeanUnitProperty.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/ABeanUnitProperty.java index 1dacb3493b..47db072633 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/ABeanUnitProperty.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/ABeanUnitProperty.java @@ -9,6 +9,8 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; + import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.CompoundCommand; import org.eclipse.emf.edit.domain.EditingDomain; @@ -55,6 +57,7 @@ public String getFormattedValueWithoutUnit() { } @Override + @XmlElement(nillable = true) public String getUnit() { return new PropertyInstanceHelper().getUnit(ti); } diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyBoolean.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyBoolean.java index 90689636b5..6901cd88c9 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyBoolean.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyBoolean.java @@ -9,6 +9,8 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; + import org.eclipse.emf.common.command.Command; import org.eclipse.emf.edit.command.SetCommand; import org.eclipse.emf.edit.domain.EditingDomain; @@ -48,6 +50,7 @@ public void setValue(Boolean bool) { } @Override + @XmlElement(nillable = true) public Boolean getValue() { return Boolean.parseBoolean(ti.getValue()); } diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyComposed.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyComposed.java index f618e1764f..f9622aa1cf 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyComposed.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyComposed.java @@ -9,6 +9,9 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + import org.eclipse.core.runtime.CoreException; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.UnexecutableCommand; @@ -19,6 +22,7 @@ import de.dlr.sc.virsat.model.concept.types.factory.BeanCategoryAssignmentFactory; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; +import de.dlr.sc.virsat.model.dvlm.json.AnyTypeAdapter; /** * Class to wrap a ComposedPropertyInstance that doesn't support to set values. @@ -47,6 +51,8 @@ public Command setValue(EditingDomain ed, BEAN_TYPE value) { return UnexecutableCommand.INSTANCE; } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(AnyTypeAdapter.class) @SuppressWarnings("unchecked") @Override public BEAN_TYPE getValue() { diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyEnum.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyEnum.java index 6bd1943943..8275f55853 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyEnum.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyEnum.java @@ -9,6 +9,8 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; + import org.eclipse.emf.common.command.Command; import org.eclipse.emf.edit.command.SetCommand; import org.eclipse.emf.edit.domain.EditingDomain; @@ -52,6 +54,7 @@ public Command setValue(EditingDomain ed, String value) { } @Override + @XmlElement(nillable = true) public void setValue(String value) { EnumProperty ep = (EnumProperty) getTypeInstance().getType(); EnumValueDefinition evd = new EnumPropertyHelper().getEvdForName(ep, value); @@ -59,6 +62,7 @@ public void setValue(String value) { } @Override + @XmlElement(nillable = true) public String getValue() { if (isSet()) { return getTypeInstance().getValue().getName(); @@ -99,6 +103,7 @@ public double getEnumValueToBaseUnit() { } @Override + @XmlElement(nillable = true) public String getUnit() { return new PropertyInstanceHelper().getUnit(ti); } diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyFloat.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyFloat.java index 377f144111..477f79e5f2 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyFloat.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyFloat.java @@ -9,12 +9,16 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + import org.eclipse.emf.common.command.Command; import org.eclipse.emf.edit.command.SetCommand; import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.json.DoubleAdapter; import de.dlr.sc.virsat.model.dvlm.qudv.AUnit; import de.dlr.sc.virsat.model.dvlm.qudv.util.QudvUnitHelper; @@ -46,9 +50,15 @@ public Command setValue(EditingDomain ed, Double value) { @Override public void setValue(Double value) { - ti.setValue(Double.toString(value)); + if (value == null) { + ti.setValue(null); + } else { + ti.setValue(Double.toString(value)); + } } + @XmlJavaTypeAdapter(DoubleAdapter.class) + @XmlElement(nillable = true) @Override public Double getValue() { try { diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyInt.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyInt.java index b165fb83a0..e1ef46420d 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyInt.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyInt.java @@ -9,6 +9,8 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; + import org.eclipse.emf.common.command.Command; import org.eclipse.emf.edit.command.SetCommand; import org.eclipse.emf.edit.domain.EditingDomain; @@ -44,10 +46,15 @@ public Command setValue(EditingDomain ed, Long value) { @Override public void setValue(Long value) { - ti.setValue(Long.toString(value)); + if (value == null) { + ti.setValue(null); + } else { + ti.setValue(Long.toString(value)); + } } @Override + @XmlElement(nillable = true) public Long getValue() throws NumberFormatException { if (isSet()) { return Long.parseLong(ti.getValue()); diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyReference.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyReference.java index d6e32c1e5a..ca84c8387e 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyReference.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyReference.java @@ -9,6 +9,9 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + import org.eclipse.core.runtime.CoreException; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.edit.command.SetCommand; @@ -16,13 +19,11 @@ import de.dlr.sc.virsat.model.concept.types.ABeanObject; import de.dlr.sc.virsat.model.concept.types.IBeanObject; -import de.dlr.sc.virsat.model.concept.types.factory.BeanCategoryAssignmentFactory; -import de.dlr.sc.virsat.model.concept.types.factory.BeanPropertyFactory; +import de.dlr.sc.virsat.model.concept.types.factory.BeanTypeInstanceFactory; import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.APropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; /** * Bean class to wrap the referenced beans of ReferencePropertyInstances @@ -63,6 +64,8 @@ public Command setValue(EditingDomain ed, BEAN_TYPE value) { @SuppressWarnings("unchecked") @Override + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) + @XmlElement(nillable = true) public BEAN_TYPE getValue() { BEAN_TYPE referencedBean = null; @@ -70,18 +73,11 @@ public BEAN_TYPE getValue() { if (isSet()) { ATypeInstance ref = ti.getReference(); - // Return the correct ca or property instance bean - if (ref instanceof CategoryAssignment) { - BeanCategoryAssignmentFactory beanCaFactory = new BeanCategoryAssignmentFactory(); - try { - referencedBean = (BEAN_TYPE) beanCaFactory.getInstanceFor((CategoryAssignment) ref); - } catch (CoreException e) { - throw new RuntimeException(e); - } - } else if (ref instanceof APropertyInstance) { - BeanPropertyFactory beanPropFactory = new BeanPropertyFactory(); - referencedBean = (BEAN_TYPE) beanPropFactory.getInstanceFor(ref); - } + try { + return (BEAN_TYPE) new BeanTypeInstanceFactory().getInstanceFor(ref); + } catch (CoreException e) { + throw new RuntimeException(e); + } } return referencedBean; diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyResource.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyResource.java index 24c64be29c..5db6fdb890 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyResource.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyResource.java @@ -9,6 +9,9 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; @@ -22,6 +25,7 @@ import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ResourcePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.json.UriAdapter; /** * Class to wrap Resource Property Instance @@ -68,6 +72,8 @@ public void setValue(URI value) { * this method returns the bean property string value * @return the bean property string value */ + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(UriAdapter.class) public URI getValue() { return ti.getUri(); } diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyString.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyString.java index 3183fe5731..29933b1e18 100644 --- a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyString.java +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/concept/types/property/BeanPropertyString.java @@ -9,6 +9,8 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.concept.types.property; +import javax.xml.bind.annotation.XmlElement; + import org.eclipse.emf.common.command.Command; import org.eclipse.emf.edit.command.SetCommand; import org.eclipse.emf.edit.domain.EditingDomain; @@ -48,6 +50,7 @@ public void setValue(String value) { } @Override + @XmlElement(nillable = true) public String getValue() { return ti.getValue(); } diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/ABeanObjectAdapter.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/ABeanObjectAdapter.java new file mode 100644 index 0000000000..69767f045c --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/ABeanObjectAdapter.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +import org.eclipse.emf.ecore.resource.ResourceSet; + +import de.dlr.sc.virsat.model.concept.types.ABeanObject; +import de.dlr.sc.virsat.model.concept.types.factory.BeanTypeInstanceFactory; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; + +@SuppressWarnings("rawtypes") +/** + * Adapter for a referenced ABeanObject from/to a UUID + * that uses the TypeInstanceAdapter + */ +public class ABeanObjectAdapter extends XmlAdapter { + + private ResourceSet resourceSet; + + public ABeanObjectAdapter() { }; + + public ABeanObjectAdapter(ResourceSet resourceSet) { + this.resourceSet = resourceSet; + } + + @Override + public String marshal(ABeanObject v) throws Exception { + if (v == null) { + return null; + } else { + return v.getUuid(); + } + } + + @Override + public ABeanObject unmarshal(String uuid) throws Exception { + if (resourceSet == null) { + throw new NullPointerException("No resource set for unmarshalling set in the adapter"); + } + + // Get the type instance from the uuid + TypeInstanceAdapter typeInstanceAdapter = new TypeInstanceAdapter(resourceSet); + ATypeInstance object = typeInstanceAdapter.unmarshal(uuid); + + return (ABeanObject) new BeanTypeInstanceFactory().getInstanceFor(object); + } + +} diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/AnyTypeAdapter.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/AnyTypeAdapter.java new file mode 100644 index 0000000000..d89754492b --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/AnyTypeAdapter.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +/** + * This XmlAdapter can be used to marshal any generic Java Object. + * This will result in a "type" attribute (XML) or key value pair (JSON) + * added to the marshalled object, which is needed for unmarshalling. + * This adapter is needed for interfaces or generics so that JAXB knows + * the concrete class to unmarshall into (Because this information is not + * provided by the annotated method otherwise). + */ +public class AnyTypeAdapter extends XmlAdapter { + + @Override + public Object unmarshal(Object v) throws Exception { + return v; + } + + @Override + public Object marshal(Object v) throws Exception { + return v; + } +} diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/DoubleAdapter.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/DoubleAdapter.java new file mode 100644 index 0000000000..e56b1c4457 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/DoubleAdapter.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +/** + * This adapter is a workaround, because NaN throws an error when being unmarshalled + */ +public class DoubleAdapter extends XmlAdapter { + + @Override + public Double unmarshal(Double v) throws Exception { + return v; + } + + @Override + public Double marshal(Double v) throws Exception { + if (v.isNaN()) { + return null; + } else { + return v; + } + } + +} diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/JAXBUtility.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/JAXBUtility.java new file mode 100644 index 0000000000..5fb685c5fb --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/JAXBUtility.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.helpers.DefaultValidationEventHandler; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.persistence.jaxb.JAXBContextProperties; + +/** + * Provides functionality to create a JAXBContext + * and corresponding marshaller and unmarshaller. + * The Class saves the state of the properties and the context. + */ +public class JAXBUtility { + + private Map properties = new HashMap<>(); + private JAXBContext jaxbCtx; + + public static final String SYSTEM_PROP_CONTEXT_FACTORY = "javax.xml.bind.context.factory"; + public static final String CLASSPATH_JAXB_CONTEXT_FACTORY = "org.eclipse.persistence.jaxb.JAXBContextFactory"; + + /** + * Default constructor + */ + public JAXBUtility() { + init(); + } + + /** + * Create a instance with JSON properties and a context from the registerClasses + * @param registerClasses classes to be recognized by the context + * @throws JAXBException + */ + public JAXBUtility(@SuppressWarnings("rawtypes") Class[] registerClasses) throws JAXBException { + init(); + createContext(registerClasses); + } + + private void init() { + System.setProperty(SYSTEM_PROP_CONTEXT_FACTORY, CLASSPATH_JAXB_CONTEXT_FACTORY); + properties.put(JAXBContextProperties.MEDIA_TYPE, "application/json"); + properties.put(JAXBContextProperties.JSON_INCLUDE_ROOT, false); + } + + public JAXBContext createContext(@SuppressWarnings("rawtypes") Class[] registerClasses) throws JAXBException { + jaxbCtx = JAXBContext.newInstance(registerClasses, properties); + return jaxbCtx; + } + + public JAXBContext getContext() { + return jaxbCtx; + } + + public Map getProperties() { + return properties; + } + + /** + * Create a new Marshaller from the context + * @return Marshaller or null if no context is set + * @throws JAXBException + */ + public Marshaller getJsonMarshaller() throws JAXBException { + if (jaxbCtx == null) { + return null; + } + + Marshaller jsonMarshaller = jaxbCtx.createMarshaller(); + jsonMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + + jsonMarshaller.setEventHandler(new DefaultValidationEventHandler()); + + return jsonMarshaller; + } + + /** + * Create a new Unmarshaller from the context and the resourceSet + * @param resourceSet containing the elements to be recognized during unmarshalling + * @return Unmarshaller or null if no context is set + * @throws JAXBException + */ + public Unmarshaller getJsonUnmarshaller(ResourceSet resourceSet) throws JAXBException { + if (jaxbCtx == null) { + return null; + } + + Unmarshaller jsonUnmarshaller = jaxbCtx.createUnmarshaller(); + + jsonUnmarshaller.setEventHandler(new DefaultValidationEventHandler()); + + TypeInstanceAdapter typeInstanceAdapter = new TypeInstanceAdapter(resourceSet); + jsonUnmarshaller.setAdapter(typeInstanceAdapter); + + ABeanObjectAdapter referenceAdapter = new ABeanObjectAdapter(resourceSet); + jsonUnmarshaller.setAdapter(referenceAdapter); + + return jsonUnmarshaller; + } +} diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/TypeInstanceAdapter.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/TypeInstanceAdapter.java new file mode 100644 index 0000000000..104443777d --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/TypeInstanceAdapter.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; + +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; + +/** + * Adapter for a ATypeInstance from/to a UUID + */ +public class TypeInstanceAdapter extends XmlAdapter { + + private ResourceSet resourceSet; + private Map objectMap = new HashMap(); + + public TypeInstanceAdapter() { + + } + + public TypeInstanceAdapter(ResourceSet resourceSet) { + this.resourceSet = resourceSet; + } + + @Override + public String marshal(ATypeInstance ti) throws Exception { + return ti.getUuid().toString(); + } + + @Override + public ATypeInstance unmarshal(String uuid) throws Exception { + if (resourceSet == null) { + throw new NullPointerException("No resource set for unmarshalling set in the adapter"); + } + + // Search for the type instance with the same uuid + EcoreUtil.getAllContents(resourceSet, true).forEachRemaining(object -> { + if (object instanceof ATypeInstance) { + ATypeInstance ti = (ATypeInstance) object; + if (ti.getUuid().toString().equals(uuid)) { + objectMap.put(uuid, ti); + } + } + }); + + ATypeInstance aTypeInstance = objectMap.get(uuid); + + if (aTypeInstance == null) { + throw new IllegalArgumentException("ATypeInstance with uuid " + uuid + " not found"); + } + return aTypeInstance; + } + +} diff --git a/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/UriAdapter.java b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/UriAdapter.java new file mode 100644 index 0000000000..82f36b0515 --- /dev/null +++ b/de.dlr.sc.virsat.model.edit/src/de/dlr/sc/virsat/model/dvlm/json/UriAdapter.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.dvlm.json; + +import javax.xml.bind.annotation.adapters.XmlAdapter; + +import org.eclipse.emf.common.util.URI; + +/** + * Adapter for a referenced URI from/to a string + */ +public class UriAdapter extends XmlAdapter { + + @Override + public URI unmarshal(String v) throws Exception { + if (v == null) { + return null; + } else { + return URI.createPlatformPluginURI(v, false); + } + } + + @Override + public String marshal(URI v) throws Exception { + if (v == null) { + return null; + } else { + return v.toPlatformString(false); + } + } + +} diff --git a/de.dlr.sc.virsat.model.ext.core.edit.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.ext.core.edit.test/META-INF/MANIFEST.MF index d637f3cbff..6f3ca900e0 100644 --- a/de.dlr.sc.virsat.model.ext.core.edit.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.ext.core.edit.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Concept Core Edit Support Test Bundle-SymbolicName: de.dlr.sc.virsat.model.ext.core.edit.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.ext.core.edit;bundle-version="0.0.1" Bundle-ClassPath: . Automatic-Module-Name: de.dlr.sc.virsat.model.ext.core.edit.test diff --git a/de.dlr.sc.virsat.model.ext.core.edit.test/about.html b/de.dlr.sc.virsat.model.ext.core.edit.test/about.html new file mode 100644 index 0000000000..39cd6411ff --- /dev/null +++ b/de.dlr.sc.virsat.model.ext.core.edit.test/about.html @@ -0,0 +1,27 @@ + + + + +About + + +

About This Content

+ +

December 18, 2018

+

License

+ +

The German Aerospace Center (DLR) makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at https://www.eclipse.org/legal/epl-2.0. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from German Aerospace Center (DLR), the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to this content.

+ + + diff --git a/de.dlr.sc.virsat.model.ext.core.edit.test/build.properties b/de.dlr.sc.virsat.model.ext.core.edit.test/build.properties index c5c67dc288..d29809feb0 100644 --- a/de.dlr.sc.virsat.model.ext.core.edit.test/build.properties +++ b/de.dlr.sc.virsat.model.ext.core.edit.test/build.properties @@ -1,4 +1,5 @@ source.. = src/ output.. = target/classes/ bin.includes = META-INF/,\ - . + .,\ + about.html diff --git a/de.dlr.sc.virsat.model.ext.core.edit.test/pom.xml b/de.dlr.sc.virsat.model.ext.core.edit.test/pom.xml index e80a0dc916..3ab903a970 100644 --- a/de.dlr.sc.virsat.model.ext.core.edit.test/pom.xml +++ b/de.dlr.sc.virsat.model.ext.core.edit.test/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.ext.core.edit/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.ext.core.edit/META-INF/MANIFEST.MF index b1d8348155..f590b3e997 100644 --- a/de.dlr.sc.virsat.model.ext.core.edit/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.ext.core.edit/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model.ext.core.edit;singleton:=true Automatic-Module-Name: de.dlr.sc.virsat.model.ext.core.edit -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Activator: de.dlr.sc.virsat.model.ext.core.core.provider.ConceptEditPlugin$Implementation Bundle-Vendor: %providerName diff --git a/de.dlr.sc.virsat.model.ext.core.edit/about.html b/de.dlr.sc.virsat.model.ext.core.edit/about.html new file mode 100644 index 0000000000..39cd6411ff --- /dev/null +++ b/de.dlr.sc.virsat.model.ext.core.edit/about.html @@ -0,0 +1,27 @@ + + + + +About + + +

About This Content

+ +

December 18, 2018

+

License

+ +

The German Aerospace Center (DLR) makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at https://www.eclipse.org/legal/epl-2.0. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from German Aerospace Center (DLR), the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to this content.

+ + + diff --git a/de.dlr.sc.virsat.model.ext.core.edit/build.properties b/de.dlr.sc.virsat.model.ext.core.edit/build.properties index 83cebeaf2d..2a3aeb2307 100644 --- a/de.dlr.sc.virsat.model.ext.core.edit/build.properties +++ b/de.dlr.sc.virsat.model.ext.core.edit/build.properties @@ -10,7 +10,8 @@ bin.includes = .,\ icons/,\ META-INF/,\ plugin.xml,\ - plugin.properties + plugin.properties,\ + about.html jars.compile.order = . source.. = src-dmf/ output.. = target/classes/ diff --git a/de.dlr.sc.virsat.model.ext.core.edit/pom.xml b/de.dlr.sc.virsat.model.ext.core.edit/pom.xml index 426b211d3c..87a0017e6f 100644 --- a/de.dlr.sc.virsat.model.ext.core.edit/pom.xml +++ b/de.dlr.sc.virsat.model.ext.core.edit/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.ext.core.feature/feature.xml b/de.dlr.sc.virsat.model.ext.core.feature/feature.xml index 3aec82e264..a1eb200068 100644 --- a/de.dlr.sc.virsat.model.ext.core.feature/feature.xml +++ b/de.dlr.sc.virsat.model.ext.core.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.ext.core.feature/pom.xml b/de.dlr.sc.virsat.model.ext.core.feature/pom.xml index bbea0e1cdb..4de9151cef 100644 --- a/de.dlr.sc.virsat.model.ext.core.feature/pom.xml +++ b/de.dlr.sc.virsat.model.ext.core.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.ext.core.feature diff --git a/de.dlr.sc.virsat.model.ext.core.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.ext.core.test/META-INF/MANIFEST.MF index 4596816500..9890cf5dba 100644 --- a/de.dlr.sc.virsat.model.ext.core.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.ext.core.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Concept Core Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.ext.core.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.ext.core;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.ext.core.test/about.html b/de.dlr.sc.virsat.model.ext.core.test/about.html new file mode 100644 index 0000000000..39cd6411ff --- /dev/null +++ b/de.dlr.sc.virsat.model.ext.core.test/about.html @@ -0,0 +1,27 @@ + + + + +About + + +

About This Content

+ +

December 18, 2018

+

License

+ +

The German Aerospace Center (DLR) makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at https://www.eclipse.org/legal/epl-2.0. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from German Aerospace Center (DLR), the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to this content.

+ + + diff --git a/de.dlr.sc.virsat.model.ext.core.test/build.properties b/de.dlr.sc.virsat.model.ext.core.test/build.properties index cb4d980fe3..cdfd339a92 100644 --- a/de.dlr.sc.virsat.model.ext.core.test/build.properties +++ b/de.dlr.sc.virsat.model.ext.core.test/build.properties @@ -2,4 +2,5 @@ source.. = src/,\ src-gen/ output.. = target/classes/ bin.includes = META-INF/,\ - . + .,\ + about.html diff --git a/de.dlr.sc.virsat.model.ext.core.test/pom.xml b/de.dlr.sc.virsat.model.ext.core.test/pom.xml index 7dfd1cf5ea..46aa926e6a 100644 --- a/de.dlr.sc.virsat.model.ext.core.test/pom.xml +++ b/de.dlr.sc.virsat.model.ext.core.test/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.ext.core.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.ext.core.ui/META-INF/MANIFEST.MF index 0ff9b80089..110cdb61d0 100644 --- a/de.dlr.sc.virsat.model.ext.core.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.ext.core.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Concept Core UI Bundle-SymbolicName: de.dlr.sc.virsat.model.ext.core.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.ext.core, org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.ext.core.ui/pom.xml b/de.dlr.sc.virsat.model.ext.core.ui/pom.xml index 78f31635e0..fec3a004c0 100644 --- a/de.dlr.sc.virsat.model.ext.core.ui/pom.xml +++ b/de.dlr.sc.virsat.model.ext.core.ui/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.ext.core/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.ext.core/META-INF/MANIFEST.MF index a1fe80c001..c811432552 100644 --- a/de.dlr.sc.virsat.model.ext.core/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.ext.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model.ext.core;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/de.dlr.sc.virsat.model.ext.core/about.html b/de.dlr.sc.virsat.model.ext.core/about.html new file mode 100644 index 0000000000..39cd6411ff --- /dev/null +++ b/de.dlr.sc.virsat.model.ext.core/about.html @@ -0,0 +1,27 @@ + + + + +About + + +

About This Content

+ +

December 18, 2018

+

License

+ +

The German Aerospace Center (DLR) makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at https://www.eclipse.org/legal/epl-2.0. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from German Aerospace Center (DLR), the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to this content.

+ + + diff --git a/de.dlr.sc.virsat.model.ext.core/build.properties b/de.dlr.sc.virsat.model.ext.core/build.properties index e82cc274b2..b532c59742 100644 --- a/de.dlr.sc.virsat.model.ext.core/build.properties +++ b/de.dlr.sc.virsat.model.ext.core/build.properties @@ -7,7 +7,8 @@ bin.includes = META-INF/,\ .,\ plugin.xml,\ concept/,\ - plugin.properties + plugin.properties,\ + about.html additional.bundles = org.eclipse.emf.mwe2.runtime,\ org.eclipse.xtend.typesystem.emf,\ org.eclipse.xpand,\ diff --git a/de.dlr.sc.virsat.model.ext.core/pom.xml b/de.dlr.sc.virsat.model.ext.core/pom.xml index ae2e85c1d8..74bad5bd37 100644 --- a/de.dlr.sc.virsat.model.ext.core/pom.xml +++ b/de.dlr.sc.virsat.model.ext.core/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.ext.core/src-gen/de/dlr/sc/virsat/model/ext/core/model/AGenericCategory.java b/de.dlr.sc.virsat.model.ext.core/src-gen/de/dlr/sc/virsat/model/ext/core/model/AGenericCategory.java index da0caac951..621fd1e2a1 100644 --- a/de.dlr.sc.virsat.model.ext.core/src-gen/de/dlr/sc/virsat/model/ext/core/model/AGenericCategory.java +++ b/de.dlr.sc.virsat.model.ext.core/src-gen/de/dlr/sc/virsat/model/ext/core/model/AGenericCategory.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.category.ABeanCategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * Implicit super category of all categories * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AGenericCategory extends ABeanCategoryAssignment implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.ext.core.GenericCategory"; diff --git a/de.dlr.sc.virsat.model.extension.budget.mass.feature/feature.xml b/de.dlr.sc.virsat.model.extension.budget.mass.feature/feature.xml index 3a7f35e7ad..f17d76589e 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.budget.mass.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.budget.mass.feature/pom.xml b/de.dlr.sc.virsat.model.extension.budget.mass.feature/pom.xml index 22a3fc3c8f..668322efd6 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.mass.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.extension.budget.mass.feature diff --git a/de.dlr.sc.virsat.model.extension.budget.mass.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.budget.mass.test/META-INF/MANIFEST.MF index c751a13691..0312321dad 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.budget.mass.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Mass Budgets Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.budget.mass.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.budget.mass;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.budget.mass.test/pom.xml b/de.dlr.sc.virsat.model.extension.budget.mass.test/pom.xml index 0e76984ae7..7d269d3a3c 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.mass.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.budget.mass.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.budget.mass.ui/META-INF/MANIFEST.MF index 942a2c24cb..ec708afa1c 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.budget.mass.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Mass Budgets UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.budget.mass.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.budget.mass, org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.budget.mass.ui/pom.xml b/de.dlr.sc.virsat.model.extension.budget.mass.ui/pom.xml index 8d4d210bb1..b45e022764 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.mass.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.budget.mass/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.budget.mass/META-INF/MANIFEST.MF index b850323765..244f362b31 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.budget.mass/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Mass Budgets Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.budget.mass;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.budget.mass/pom.xml b/de.dlr.sc.virsat.model.extension.budget.mass/pom.xml index ff87ef2e4d..89ea3fc01f 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.mass/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AAMassParameters.java b/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AAMassParameters.java index 6b1dff3d05..bd454d8f49 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AAMassParameters.java +++ b/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AAMassParameters.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * Definition of the equipment mass * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AAMassParameters extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.mass.AMassParameters"; @@ -106,6 +112,7 @@ public boolean isSetMass() { return mass.isSet(); } + @XmlElement public BeanPropertyFloat getMassBean() { safeAccessMass(); return mass; @@ -142,6 +149,7 @@ public boolean isSetMassWithMargin() { return massWithMargin.isSet(); } + @XmlElement public BeanPropertyFloat getMassWithMarginBean() { safeAccessMassWithMargin(); return massWithMargin; @@ -178,6 +186,7 @@ public boolean isSetMassMargin() { return massMargin.isSet(); } + @XmlElement public BeanPropertyFloat getMassMarginBean() { safeAccessMassMargin(); return massMargin; @@ -214,6 +223,7 @@ public boolean isSetMargin() { return margin.isSet(); } + @XmlElement public BeanPropertyFloat getMarginBean() { safeAccessMargin(); return margin; diff --git a/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassEquipment.java b/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassEquipment.java index bdf45e1484..88f1f61599 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassEquipment.java +++ b/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassEquipment.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * Definition of the equipment mass * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AMassEquipment extends AMassParameters implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.mass.MassEquipment"; diff --git a/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassSummary.java b/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassSummary.java index d0defc79e2..5fa855467a 100644 --- a/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassSummary.java +++ b/de.dlr.sc.virsat.model.extension.budget.mass/src-gen/de/dlr/sc/virsat/model/extension/budget/mass/model/AMassSummary.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * Summary of all nested equipment masses * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AMassSummary extends AMassParameters implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.mass.MassSummary"; diff --git a/de.dlr.sc.virsat.model.extension.budget.power.feature/feature.xml b/de.dlr.sc.virsat.model.extension.budget.power.feature/feature.xml index 8c87522304..cae0a62a2d 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.budget.power.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.budget.power.feature/pom.xml b/de.dlr.sc.virsat.model.extension.budget.power.feature/pom.xml index 9d55168abe..a9403ed0ec 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.power.feature/pom.xml @@ -13,7 +13,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.budget.power.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.budget.power.test/META-INF/MANIFEST.MF index 06bfd5a82a..a801d892ac 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.budget.power.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Power Budgets Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.budget.power.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.budget.power Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.budget.power.test/pom.xml b/de.dlr.sc.virsat.model.extension.budget.power.test/pom.xml index db9af28e4a..55f6cf18fc 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.power.test/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.budget.power.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.budget.power.ui/META-INF/MANIFEST.MF index 2fe95ba434..26bf4ff17d 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.budget.power.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Power Budgets UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.budget.power.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.core.expressions, diff --git a/de.dlr.sc.virsat.model.extension.budget.power.ui/pom.xml b/de.dlr.sc.virsat.model.extension.budget.power.ui/pom.xml index d877871e79..22a0eae77b 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.power.ui/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.budget.power/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.budget.power/META-INF/MANIFEST.MF index d08beb2b43..b12cf4c0c4 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.budget.power/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Power Budgets Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.budget.power;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.budget.power/pom.xml b/de.dlr.sc.virsat.model.extension.budget.power/pom.xml index 620640ee57..b1f9864125 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power/pom.xml +++ b/de.dlr.sc.virsat.model.extension.budget.power/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/AAPowerParameters.java b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/AAPowerParameters.java index 70d380e959..a37ee19a84 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/AAPowerParameters.java +++ b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/AAPowerParameters.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * Abstract definition of a collection of power parameters * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AAPowerParameters extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.power.APowerParameters"; @@ -108,6 +114,7 @@ public boolean isSetAvgPower() { return avgPower.isSet(); } + @XmlElement public BeanPropertyFloat getAvgPowerBean() { safeAccessAvgPower(); return avgPower; @@ -144,6 +151,7 @@ public boolean isSetMinPower() { return minPower.isSet(); } + @XmlElement public BeanPropertyFloat getMinPowerBean() { safeAccessMinPower(); return minPower; @@ -180,6 +188,7 @@ public boolean isSetMaxPower() { return maxPower.isSet(); } + @XmlElement public BeanPropertyFloat getMaxPowerBean() { safeAccessMaxPower(); return maxPower; @@ -216,6 +225,7 @@ public boolean isSetAvgPowerWithMargin() { return avgPowerWithMargin.isSet(); } + @XmlElement public BeanPropertyFloat getAvgPowerWithMarginBean() { safeAccessAvgPowerWithMargin(); return avgPowerWithMargin; @@ -252,6 +262,7 @@ public boolean isSetAvgPowerMargin() { return avgPowerMargin.isSet(); } + @XmlElement public BeanPropertyFloat getAvgPowerMarginBean() { safeAccessAvgPowerMargin(); return avgPowerMargin; @@ -288,6 +299,7 @@ public boolean isSetMargin() { return margin.isSet(); } + @XmlElement public BeanPropertyFloat getMarginBean() { safeAccessMargin(); return margin; diff --git a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerEquipment.java b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerEquipment.java index 0af8be869d..9776fd0826 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerEquipment.java +++ b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerEquipment.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; -import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; -import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * Definition of the equipment power * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class APowerEquipment extends APowerParameters implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.power.PowerEquipment"; @@ -96,6 +102,7 @@ private void safeAccessPowerValuesBean() { } } + @XmlElement public IBeanList> getPowerValuesBean() { safeAccessPowerValuesBean(); return powerValuesBean; diff --git a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerState.java b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerState.java index 0fa7fc321d..6aa788c0ae 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerState.java +++ b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerState.java @@ -12,20 +12,26 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; import de.dlr.sc.virsat.model.extension.statemachines.model.State; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -40,6 +46,8 @@ * Power data for a single equipment mode * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class APowerState extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.power.PowerState"; @@ -88,6 +96,8 @@ private void safeAccessMode() { mode.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public State getMode() { safeAccessMode(); return mode.getValue(); @@ -139,6 +149,7 @@ public boolean isSetPower() { return power.isSet(); } + @XmlElement public BeanPropertyFloat getPowerBean() { safeAccessPower(); return power; @@ -175,6 +186,7 @@ public boolean isSetAvgPower() { return avgPower.isSet(); } + @XmlElement public BeanPropertyFloat getAvgPowerBean() { safeAccessAvgPower(); return avgPower; @@ -211,6 +223,7 @@ public boolean isSetDutyCycle() { return dutyCycle.isSet(); } + @XmlElement public BeanPropertyFloat getDutyCycleBean() { safeAccessDutyCycle(); return dutyCycle; diff --git a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerSummary.java b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerSummary.java index 534813bb8b..6b28f82ffe 100644 --- a/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerSummary.java +++ b/de.dlr.sc.virsat.model.extension.budget.power/src-gen/de/dlr/sc/virsat/model/extension/budget/power/model/APowerSummary.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * Summary of all nested equipment powers * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class APowerSummary extends APowerParameters implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.budget.power.PowerSummary"; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.feature/feature.xml b/de.dlr.sc.virsat.model.extension.funcelectrical.feature/feature.xml index 224b296647..3e8ddd6d82 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.feature/pom.xml b/de.dlr.sc.virsat.model.extension.funcelectrical.feature/pom.xml index 984df83235..ed3d244899 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.feature/pom.xml @@ -13,7 +13,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.funcelectrical.test/META-INF/MANIFEST.MF index 2af043630d..bd76e52659 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Functional Eclectrical Interfaces Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.funcelectrical.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Fragment-Host: de.dlr.sc.virsat.model.extension.funcelectrical Export-Package: de.dlr.sc.virsat.model.extension.funcelectrical.test, diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.test/pom.xml b/de.dlr.sc.virsat.model.extension.funcelectrical.test/pom.xml index dbe9dc4b69..9f65cee7d5 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.test/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.test/resources/SampleTest.xlsx b/de.dlr.sc.virsat.model.extension.funcelectrical.test/resources/SampleTest.xlsx index 5d03d48505..d999f6c362 100644 Binary files a/de.dlr.sc.virsat.model.extension.funcelectrical.test/resources/SampleTest.xlsx and b/de.dlr.sc.virsat.model.extension.funcelectrical.test/resources/SampleTest.xlsx differ diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.test/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporterTest.java b/de.dlr.sc.virsat.model.extension.funcelectrical.test/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporterTest.java index 132833f3a4..7dd7c9d631 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.test/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporterTest.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.test/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporterTest.java @@ -62,7 +62,8 @@ public void testExportTypes() { Sheet sheet = wb.getSheet(AExcelFuncIO.TEMPLATE_SHEETNAME_INTERFACETYPES); for (int i = 0; i < sei.getCategoryAssignments().size(); ++i) { CategoryAssignment interfaceType = sei.getCategoryAssignments().get(i); - Cell cell = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i).getCell(AExcelFuncIO.INTERFACETYPES_COLUMN_INTERFACETYPE_NAME); + Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i); + Cell cell = row.getCell(AExcelFuncIO.INTERFACETYPES_COLUMN_INTERFACETYPE_NAME); assertEquals("Type " + i + "exported correctly", interfaceType.getName(), cell.toString()); } } @@ -78,8 +79,12 @@ public void testExportInterfaceEnds() throws IOException { Sheet sheet = wb.getSheet(AExcelFuncIO.TEMPLATE_SHEETNAME_INTERFACEENDS); for (int i = 0; i < sei.getCategoryAssignments().size(); ++i) { - Cell cell = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i).getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME); - assertEquals("Interface end exported correctly", sei.getCategoryAssignments().get(i).getName(), cell.toString()); + CategoryAssignment interfaceEnd = sei.getCategoryAssignments().get(i); + Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i); + Cell cell = row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME); + assertEquals("Interface end name exported correctly", interfaceEnd.getName(), cell.toString()); + cell = row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_FQN); + assertEquals("Interface end fqn exported correctly", interfaceEnd.getFullQualifiedInstanceName(), cell.toString()); } Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + sei.getCategoryAssignments().size()); assertNull("Line after alle entries correctly empty", row); @@ -97,7 +102,8 @@ public void testExportInterfaces() throws IOException { Sheet sheet = wb.getSheet(AExcelFuncIO.TEMPLATE_SHEETNAME_INTERFACES); for (int i = 0; i < sei.getCategoryAssignments().size(); ++i) { - Cell cell = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i).getCell(AExcelFuncIO.INTERFACE_COLUMN_INTERFACE_NAME); + Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i); + Cell cell = row.getCell(AExcelFuncIO.INTERFACE_COLUMN_INTERFACE_NAME); assertEquals("Interface exported correctly", sei.getCategoryAssignments().get(i).getName(), cell.toString()); } assertNull("Line after all entries correctly empty", sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + sei.getCategoryAssignments().size())); @@ -117,7 +123,8 @@ public void testExportTypesIntoEmptyWorkbook() throws IOException { for (int i = 0; i < sei.getCategoryAssignments().size(); ++i) { CategoryAssignment interfaceType = sei.getCategoryAssignments().get(i); - Cell cell = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i).getCell(AExcelFuncIO.INTERFACETYPES_COLUMN_INTERFACETYPE_NAME); + Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i); + Cell cell = row.getCell(AExcelFuncIO.INTERFACETYPES_COLUMN_INTERFACETYPE_NAME); assertEquals("Type " + i + "exported correctly", interfaceType.getName(), cell.toString()); } assertNull("Line after all entries correctly empty", sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + sei.getCategoryAssignments().size())); @@ -135,8 +142,12 @@ public void testExportInterfacesIntoEmptyWorkbook() throws IOException { Sheet sheet = wb.getSheet(AExcelFuncIO.TEMPLATE_SHEETNAME_INTERFACEENDS); for (int i = 0; i < sei.getCategoryAssignments().size(); ++i) { - Cell cell = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i).getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME); - assertEquals("Interface end exported correctly", sei.getCategoryAssignments().get(i).getName(), cell.toString()); + CategoryAssignment interfaceEnd = sei.getCategoryAssignments().get(i); + Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i); + Cell cell = row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME); + assertEquals("Interface end name exported correctly", interfaceEnd.getName(), cell.toString()); + cell = row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_FQN); + assertEquals("Interface end fqn exported correctly", interfaceEnd.getFullQualifiedInstanceName(), cell.toString()); } assertNull("Line after all entries correctly empty", sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + sei.getCategoryAssignments().size())); } @@ -153,8 +164,12 @@ public void testExportInterfaceEndsIntoEmptyWorkbook() throws IOException { Sheet sheet = wb.getSheet(AExcelFuncIO.TEMPLATE_SHEETNAME_INTERFACEENDS); for (int i = 0; i < sei.getCategoryAssignments().size(); ++i) { - Cell cell = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i).getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME); - assertEquals("Interface end exported correctly", sei.getCategoryAssignments().get(i).getName(), cell.toString()); + CategoryAssignment interfaceEnd = sei.getCategoryAssignments().get(i); + Row row = sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + i); + Cell cell = row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME); + assertEquals("Interface end name exported correctly", interfaceEnd.getName(), cell.toString()); + cell = row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_FQN); + assertEquals("Interface end fqn exported correctly", interfaceEnd.getFullQualifiedInstanceName(), cell.toString()); } assertNull("Line after all entries correctly empty", sheet.getRow(AExcelFuncIO.COMMON_ROW_START_TABLE + sei.getCategoryAssignments().size())); } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/META-INF/MANIFEST.MF index efd4b61c3d..5b285baa93 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Functional Eclectrical Interfaces UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.funcelectrical.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.funcelectrical, org.eclipse.core.runtime, org.eclipse.emf.edit, diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/pom.xml b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/pom.xml index 35462bad3c..375a6523a6 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/InterfaceDiagramFeatureProvider.java b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/InterfaceDiagramFeatureProvider.java index 240eb732b9..b2dedb1b3e 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/InterfaceDiagramFeatureProvider.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/InterfaceDiagramFeatureProvider.java @@ -10,6 +10,10 @@ package de.dlr.sc.virsat.model.extension.funcelectrical.ui.diagram.features; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import org.eclipse.graphiti.dt.IDiagramTypeProvider; import org.eclipse.graphiti.features.IAddFeature; import org.eclipse.graphiti.features.ICopyFeature; @@ -53,6 +57,7 @@ import de.dlr.sc.virsat.graphiti.ui.diagram.feature.VirSatStructuralElementInstanceCopyFeature; import de.dlr.sc.virsat.graphiti.ui.diagram.feature.VirSatStructuralElementInstancePasteFeature; import de.dlr.sc.virsat.graphiti.ui.diagram.feature.VirsatCategoryAssignmentOpenEditorFeature; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.structural.ABeanStructuralElementInstance; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; @@ -230,18 +235,23 @@ public IMoveShapeFeature getMoveShapeFeature(IMoveShapeContext context) { @Override public ICustomFeature[] getCustomFeatures(ICustomContext context) { - PictogramElement[] pictogramElements = context.getPictogramElements(); Object object = getBusinessObjectForPictogramElement(pictogramElements[0]); - if (object instanceof ABeanStructuralElementInstance) { - return new ICustomFeature[] { new VirSatChangeColorFeature(this)}; - } + List customFeatures = new ArrayList<>(); if (object instanceof InterfaceEnd) { - return new ICustomFeature[] { new VirsatCategoryAssignmentOpenEditorFeature(this), new InterfaceEndChangeColorFeature(this)}; + customFeatures.add(new InterfaceEndChangeColorFeature(this)); + } else { + customFeatures.add(new VirSatChangeColorFeature(this)); } - return super.getCustomFeatures(context); + + if (object instanceof IBeanCategoryAssignment) { + customFeatures.add(new VirsatCategoryAssignmentOpenEditorFeature(this)); + } + + Collections.addAll(customFeatures, super.getCustomFeatures(context)); + return customFeatures.toArray(new ICustomFeature[0]); } @Override diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/elements/ElementLayoutFeature.java b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/elements/ElementLayoutFeature.java index e6a8ecfe32..a256034fb1 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/elements/ElementLayoutFeature.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/elements/ElementLayoutFeature.java @@ -110,7 +110,7 @@ public boolean layout(ILayoutContext context) { } } // reposition all the anchors - DiagramUtils.repositionShapes(containerShape, getFeatureProvider()); + DiagramUtils.repositionInterfaceEndShapes(containerShape, getFeatureProvider()); return anythingChanged; } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndAddFeature.java b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndAddFeature.java index 6ce1f4d4c8..93d9832541 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndAddFeature.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndAddFeature.java @@ -191,7 +191,7 @@ public PictogramElement add(IAddContext context) { } // reposition all the anchors // reposition all the anchors - DiagramUtils.repositionShapes(targetContainer, getFeatureProvider()); + DiagramUtils.repositionInterfaceEndShapes(targetContainer, getFeatureProvider()); return boxAnchor; } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndMoveFeature.java b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndMoveFeature.java index d8e141d0b1..af904d8c66 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndMoveFeature.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/features/interfaceends/InterfaceEndMoveFeature.java @@ -71,6 +71,6 @@ protected void postMoveShape(IMoveShapeContext context) { } // reposition all the anchors - DiagramUtils.repositionShapes(containerShape, getFeatureProvider()); + DiagramUtils.repositionInterfaceEndShapes(containerShape, getFeatureProvider()); } } \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/utils/DiagramUtils.java b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/utils/DiagramUtils.java index d020cd154c..4a28f4e8ca 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/utils/DiagramUtils.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/diagram/utils/DiagramUtils.java @@ -49,7 +49,6 @@ private DiagramUtils() { * @return desired height * @param containerShape the element * @param featureProvider the feature provider - * @author bell_er * */ public static int getRequiredHeight(ContainerShape containerShape, IFeatureProvider featureProvider) { @@ -71,30 +70,53 @@ public static int getRequiredHeight(ContainerShape containerShape, IFeatureProvi return maxHeight; } + /** * The function to reposition interface ends * @param containerShape the element * @param featureProvider the feature provider - * @author bell_er * */ - public static void repositionShapes(ContainerShape containerShape, IFeatureProvider featureProvider) { - ArrayList ieLeft = new ArrayList(); - ArrayList ieRight = new ArrayList(); + public static void repositionInterfaceEndShapes(ContainerShape containerShape, IFeatureProvider featureProvider) { + List ieLeft = new ArrayList<>(); + List ieRight = new ArrayList<>(); getLeftRightInterfaceEndShapes(containerShape, featureProvider, ieLeft, ieRight); + repositionInterfaceEndShapes(ieLeft); + repositionInterfaceEndShapes(ieRight); + } + + /** + * The function to reposition interface ends + * @param containerShape the element + * @param featureProvider the feature provider + * + */ + public static void repositionInterfaceEndShapes(List shapes) { int i = 2; - for (Shape shape : ieLeft) { + for (Shape shape : shapes) { int height = (ElementAddFeature.PADDING_Y + InterfaceEndAddFeature.INTERFACE_END_HEIGHT) * i; shape.getGraphicsAlgorithm().setY(height); i++; } - i = 2; - for (Shape shape : ieRight) { - int height = (ElementAddFeature.PADDING_Y + InterfaceEndAddFeature.INTERFACE_END_HEIGHT) * i; - shape.getGraphicsAlgorithm().setY(height); - i++; - } } + + private static final Comparator Y_POSITION_COMPARATOR = (Shape o1, Shape o2) -> { + Shape shape1 = (Shape) o1; + Shape shape2 = (Shape) o2; + double diff = shape1.getGraphicsAlgorithm().getY() - shape2.getGraphicsAlgorithm().getY(); + return Double.compare(diff, 0); + }; + + /** + * Checks if a given interface end is positioned on the right side of an element or not + * @param interfaceEndShape the diagram shape of the interface end + * @return true iff the the interface end is positione on the right side. False implies that it is on the left side. + */ + private static boolean isRightInterfaceEnd(ContainerShape interfaceEndShape) { + Text text = (Text) interfaceEndShape.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0); + return text.getHorizontalAlignment() == Orientation.ALIGNMENT_RIGHT; + } + /** * The function to return the left right anchors of an element * @return right anchors @@ -102,40 +124,32 @@ public static void repositionShapes(ContainerShape containerShape, IFeatureProvi * @param featureProvider the feature provider * @param ieLeft interface ends on the left * @param ieRight interface ends on the right - * @author bell_er * */ - public static ArrayList getLeftRightInterfaceEndShapes(ContainerShape containerShape, IFeatureProvider featureProvider, ArrayList ieLeft, ArrayList ieRight) { + public static void getLeftRightInterfaceEndShapes(ContainerShape containerShape, IFeatureProvider featureProvider, List ieLeft, List ieRight) { for (Shape shape : containerShape.getChildren()) { if (shape instanceof ContainerShape) { ContainerShape childShape = (ContainerShape) shape; Object bo = featureProvider.getBusinessObjectForPictogramElement(shape); - Text text = (Text) childShape.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0); - text.getHorizontalAlignment(); - if (text.getHorizontalAlignment() == Orientation.ALIGNMENT_LEFT && bo instanceof InterfaceEnd) { - ieRight.add(shape); - } else { - ieLeft.add(shape); - } + if (bo instanceof InterfaceEnd) { + if (isRightInterfaceEnd(childShape)) { + ieRight.add(shape); + } else { + ieLeft.add(shape); + } + } } } - Collections.sort(ieRight, new Comparator() { - @Override - public int compare(Shape o1, Shape o2) { - Shape shape1 = (Shape) o1; - Shape shape2 = (Shape) o2; - double diff = shape1.getGraphicsAlgorithm().getY() - shape2.getGraphicsAlgorithm().getY(); - return Double.compare(diff, 0); - } - }); - return ieRight; + + Collections.sort(ieRight, Y_POSITION_COMPARATOR); + Collections.sort(ieLeft, Y_POSITION_COMPARATOR); } + /** * The function to calculate the minimum width to fit interfaceEnds * @return width the needed width * @param addedElement sei to be represented * @param font font of the texts - * @author bell_er * */ public static int neededWidth(ABeanStructuralElementInstance addedElement, Font font) { diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/wizards/HTMLExportPage.java b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/wizards/HTMLExportPage.java index 15f5fe5ccd..302658d840 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/wizards/HTMLExportPage.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical.ui/src/de/dlr/sc/virsat/model/extension/funcelectrical/ui/wizards/HTMLExportPage.java @@ -19,6 +19,8 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -180,13 +182,27 @@ private void createExportUI() { final int widthHint = 250; data.widthHint = widthHint; destinationField.setLayoutData(data); + destinationField.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + String selectedDirectoryName = destinationField.getText(); + if (selectedDirectoryName.equals("")) { + destination = false; + } else { + destination = true; + getDialogSettings().put(DESTINATION_FILE_KEY, selectedDirectoryName); + } + + setPageComplete(isComplete()); + } + }); String defaultDestination = wizardSettings.get(DESTINATION_FILE_KEY); if (defaultDestination != null) { destinationField.setText(defaultDestination); - destination = true; } + // destination browse button final Button destinationBrowseButton = new Button(composite, SWT.PUSH); destinationBrowseButton.setText(BUTTON_TEXT); @@ -201,9 +217,6 @@ public void handleEvent(Event event) { if (selectedDirectoryName != null) { setErrorMessage(null); destinationField.setText(selectedDirectoryName); - destination = true; - wizardSettings.put(DESTINATION_FILE_KEY, selectedDirectoryName); - setPageComplete(isComplete()); } } }); @@ -232,13 +245,6 @@ public String getDestination() { * @return true iff the page is complete */ public boolean isComplete() { - - if (selection == null || !destination) { - return false; - } - - return true; - - + return selection != null && destination; } } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.funcelectrical/META-INF/MANIFEST.MF index 7f0feae99a..c41b1a7e00 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Functional Eclectrical Interfaces Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.funcelectrical;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/plugin.properties b/de.dlr.sc.virsat.model.extension.funcelectrical/plugin.properties deleted file mode 100644 index e7f206f687..0000000000 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/plugin.properties +++ /dev/null @@ -1,4 +0,0 @@ -# - -pluginName = Concept Model -providerName = www.example.org diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/pom.xml b/de.dlr.sc.virsat.model.extension.funcelectrical/pom.xml index f7b3f3738a..d89d46549e 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/pom.xml +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/resources/ExcelExportTemplate.xlsx b/de.dlr.sc.virsat.model.extension.funcelectrical/resources/ExcelExportTemplate.xlsx index 26ac1b47ec..99a8fd3d44 100644 Binary files a/de.dlr.sc.virsat.model.extension.funcelectrical/resources/ExcelExportTemplate.xlsx and b/de.dlr.sc.virsat.model.extension.funcelectrical/resources/ExcelExportTemplate.xlsx differ diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ADataInterfaceType.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ADataInterfaceType.java index 878eb7cdec..6965ee1056 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ADataInterfaceType.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ADataInterfaceType.java @@ -12,16 +12,20 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import org.eclipse.emf.common.command.Command; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -36,6 +40,8 @@ * Describes a Data communication interface type * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ADataInterfaceType extends InterfaceType implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.DataInterfaceType"; @@ -97,6 +103,7 @@ public String getElectricalStandard() { return electricalStandard.getValue(); } + @XmlElement public BeanPropertyString getElectricalStandardBean() { safeAccessElectricalStandard(); return electricalStandard; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AFixedVoltageDefinition.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AFixedVoltageDefinition.java index ac59b53408..61be8fef0b 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AFixedVoltageDefinition.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AFixedVoltageDefinition.java @@ -12,16 +12,20 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -36,6 +40,8 @@ * Fixed voltage defining a nominal value * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AFixedVoltageDefinition extends VoltageDefinition implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.FixedVoltageDefinition"; @@ -102,6 +108,7 @@ public boolean isSetNominalValue() { return nominalValue.isSet(); } + @XmlElement public BeanPropertyFloat getNominalValueBean() { safeAccessNominalValue(); return nominalValue; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterface.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterface.java index 54b5fa9258..32c7432299 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterface.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterface.java @@ -12,17 +12,23 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; -import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import org.eclipse.emf.edit.domain.EditingDomain; -import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +43,8 @@ * Describes a Functional Electrical Interface connecting two InterfaceEnds * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AInterface extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.Interface"; @@ -83,6 +91,8 @@ private void safeAccessInterfaceEndFrom() { interfaceEndFrom.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public InterfaceEnd getInterfaceEndFrom() { safeAccessInterfaceEndFrom(); return interfaceEndFrom.getValue(); @@ -113,6 +123,8 @@ private void safeAccessInterfaceEndTo() { interfaceEndTo.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public InterfaceEnd getInterfaceEndTo() { safeAccessInterfaceEndTo(); return interfaceEndTo.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceEnd.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceEnd.java index 5d1df2a193..caf17e3adc 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceEnd.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceEnd.java @@ -12,17 +12,23 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; -import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import org.eclipse.emf.edit.domain.EditingDomain; -import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +43,8 @@ * Describes a Functional Electrical InterfaceEnd as connection point for Interfaces * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AInterfaceEnd extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.InterfaceEnd"; @@ -82,6 +90,8 @@ private void safeAccessType() { type.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public InterfaceType getType() { safeAccessType(); return type.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceType.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceType.java index 8b40ac3eb3..df78b897bf 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceType.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AInterfaceType.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * InterfaceTypes such as MIL or CAN to type communication of InterfaceEnds * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AInterfaceType extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.InterfaceType"; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/APowerInterfaceType.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/APowerInterfaceType.java index af93c23fad..b0bcb3b1b6 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/APowerInterfaceType.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/APowerInterfaceType.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; -import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; -import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * Describes a Power interface type with nominal voltages * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class APowerInterfaceType extends InterfaceType implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.PowerInterfaceType"; @@ -96,6 +102,7 @@ private void safeAccessVoltagesBean() { } } + @XmlElement public IBeanList> getVoltagesBean() { safeAccessVoltagesBean(); return voltagesBean; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ARangedVoltageDefinition.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ARangedVoltageDefinition.java index 53a4bb43fe..f4da13e41c 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ARangedVoltageDefinition.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/ARangedVoltageDefinition.java @@ -12,16 +12,20 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -36,6 +40,8 @@ * Interval range of nominal voltages * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ARangedVoltageDefinition extends VoltageDefinition implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.RangedVoltageDefinition"; @@ -103,6 +109,7 @@ public boolean isSetMinVoltage() { return minVoltage.isSet(); } + @XmlElement public BeanPropertyFloat getMinVoltageBean() { safeAccessMinVoltage(); return minVoltage; @@ -139,6 +146,7 @@ public boolean isSetMaxVoltage() { return maxVoltage.isSet(); } + @XmlElement public BeanPropertyFloat getMaxVoltageBean() { safeAccessMaxVoltage(); return maxVoltage; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AThermalReferencePoint.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AThermalReferencePoint.java index 1f06a2a20e..ef5ee5c92f 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AThermalReferencePoint.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AThermalReferencePoint.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * Describes a thermal communication interface type * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AThermalReferencePoint extends DataInterfaceType implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.ThermalReferencePoint"; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AVoltageDefinition.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AVoltageDefinition.java index 53a9492ca4..f84116b0df 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AVoltageDefinition.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src-gen/de/dlr/sc/virsat/model/extension/funcelectrical/model/AVoltageDefinition.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * Abstract voltage definition * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AVoltageDefinition extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.funcelectrical.VoltageDefinition"; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/AExcelFuncIO.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/AExcelFuncIO.java index 3238c373fd..0d6ec02137 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/AExcelFuncIO.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/AExcelFuncIO.java @@ -13,6 +13,12 @@ public abstract class AExcelFuncIO extends AExcelIo { + public static final int INTERFACE_COLUMN_INTERFACE_TO = 4; + + public static final int INTERFACEEND_COLUMN_INTERFACEEND_NAME = 2; + public static final int INTERFACEEND_COLUMN_INTERFACEEND_TYPE = 3; + public static final int INTERFACEEND_COLUMN_INTERFACEEND_FQN = 4; + public static final int INTERFACE_COLUMN_INTERFACE_NAME = 2; public static final int INTERFACE_COLUMN_INTERFACE_FROM = 3; public static final int INTERFACETYPES_COLUMN_INTERFACETYPE_NAME = 2; diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporter.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporter.java index 26305db25a..d9c8993006 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporter.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/exporter/FuncElecExporter.java @@ -10,6 +10,7 @@ package de.dlr.sc.virsat.model.extension.funcelectrical.excel.exporter; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -24,14 +25,11 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.eclipse.core.runtime.Status; import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.swt.widgets.Display; - +import org.eclipse.ui.statushandlers.StatusManager; import de.dlr.sc.virsat.excel.exporter.ExcelExportHelper; import de.dlr.sc.virsat.excel.exporter.IExport; import de.dlr.sc.virsat.model.concept.types.util.BeanCategoryAssignmentHelper; -import de.dlr.sc.virsat.model.dvlm.provider.DVLMEditPlugin; import de.dlr.sc.virsat.model.dvlm.structural.StructuralElementInstance; import de.dlr.sc.virsat.model.extension.funcelectrical.Activator; import de.dlr.sc.virsat.model.extension.funcelectrical.excel.AExcelFuncIO; @@ -49,14 +47,8 @@ */ public class FuncElecExporter implements IExport { - public FuncElecExporter(LocalDateTime localDateTime) { - this.localDateTime = localDateTime; - } - - protected LocalDateTime localDateTime; private static final String DEFAULT_TEMPLATE_PATH = "/resources/ExcelExportTemplate.xlsx"; - private ExcelExportHelper helper; - + private static final String[] EXPORTABLE_SEIS = { ElementDefinition.class.getSimpleName(), ElementConfiguration.class.getSimpleName(), @@ -64,31 +56,39 @@ public FuncElecExporter(LocalDateTime localDateTime) { ElementRealization.class.getSimpleName(), ElementOccurence.class.getSimpleName() }; + + protected LocalDateTime localDateTime; + private ExcelExportHelper helper; + + public FuncElecExporter() { + this(LocalDateTime.now()); + } + + public FuncElecExporter(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } @Override public void export(EObject eObject, String path, boolean useDefaultTemplate, String templatePath) { StructuralElementInstance parentSc = (StructuralElementInstance) eObject; - ArrayList seis = new ArrayList(); + List seis = new ArrayList<>(); seis.add(parentSc); seis.addAll(parentSc.getDeepChildren()); for (StructuralElementInstance sei : seis) { String selectedSEIType = sei.getType().getName(); if (Stream.of(EXPORTABLE_SEIS).anyMatch(exportable -> exportable.equals(selectedSEIType))) { - InputStream iStream = null; try { - if (useDefaultTemplate) { - iStream = Activator.getResourceContentAsString(DEFAULT_TEMPLATE_PATH); - } else { - iStream = Activator.getResourceContentAsString(templatePath); - } + InputStream iStream = useDefaultTemplate + ? Activator.getResourceContentAsString(DEFAULT_TEMPLATE_PATH) + : new FileInputStream(templatePath); + export(sei, iStream); File file = new File(path + "/" + sei.getFullQualifiedInstanceName() + ".xlsx"); FileOutputStream out = new FileOutputStream(file); helper.getWb().write(out); } catch (IOException e) { Status status = new Status(Status.ERROR, Activator.getPluginId(), "Failed to perform an export operation!" + System.lineSeparator() + e.getMessage(), e); - DVLMEditPlugin.getPlugin().getLog().log(status); - ErrorDialog.openError(Display.getDefault().getActiveShell(), "Excel IO Failed", "Export failed", status); + StatusManager.getManager().handle(status, StatusManager.LOG | StatusManager.SHOW); } } } @@ -108,10 +108,7 @@ protected void export(StructuralElementInstance sei, InputStream iStream) { @Override public boolean canExport(Object selection) { - if (selection instanceof StructuralElementInstance) { - return true; - } - return false; + return selection instanceof StructuralElementInstance; } /** * Exports depending on the type of the Structural element @@ -203,7 +200,7 @@ private void createDataSheetInterfaceEnds(StructuralElementInstance exportSei) { // get all the interface ends BeanCategoryAssignmentHelper bCaHelper = new BeanCategoryAssignmentHelper(); List seiInterfaceEnds = bCaHelper.getAllBeanCategories(exportSei, InterfaceEnd.class); - helper.instantiateCells(sheet, seiInterfaceEnds.size() + AExcelFuncIO.COMMON_ROW_START_TABLE, AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_TYPE + 1); + helper.instantiateCells(sheet, seiInterfaceEnds.size() + AExcelFuncIO.COMMON_ROW_START_TABLE, AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_FQN + 1); // for each interface end, fill out a row int i = AExcelFuncIO.COMMON_ROW_START_TABLE; @@ -213,6 +210,7 @@ private void createDataSheetInterfaceEnds(StructuralElementInstance exportSei) { row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME).setCellValue(helper.getCreationHelper().createRichTextString(ifaceEnd.getName())); row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_TYPE).setCellValue(helper.getCreationHelper().createRichTextString("")); row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_TYPE).setCellValue(helper.getCreationHelper().createRichTextString(getIfeTypeName(ifaceEnd))); + row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_FQN).setCellValue(helper.getCreationHelper().createRichTextString(ifaceEnd.getTypeInstance().getFullQualifiedInstanceName())); i++; } } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/FuncElecImporter.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/FuncElecImporter.java index 2f5a8f486b..7175f9b98b 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/FuncElecImporter.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/FuncElecImporter.java @@ -140,7 +140,8 @@ private void importInterfaceEnds() { seiInterfaceEnds.get(check).setName(tempInterfaceEndName); // if type exists change the type, if not return a fault int interfaceTypeIndex = ExcelImportHelper.containsABeanCategoryAssignmentName(row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_TYPE).toString(), ifaceTypes); - seiInterfaceEnds.get(check).setType(ifaceTypes.get(interfaceTypeIndex)); + InterfaceType interfaceType = (interfaceTypeIndex >= 0) ? ifaceTypes.get(interfaceTypeIndex) : null; + seiInterfaceEnds.get(check).setType(interfaceType); } } } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/ImportValidator.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/ImportValidator.java index 7e6dafc67c..9d09d4dabc 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/ImportValidator.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/excel/importer/ImportValidator.java @@ -144,9 +144,11 @@ private void validateInterfaceEnds() { } // control if the interface Type Exists String type = Objects.toString(row.getCell(AExcelFuncIO.INTERFACEEND_COLUMN_INTERFACEEND_TYPE), ""); - int interfaceTypeIndex = ExcelImportHelper.containsABeanCategoryAssignmentName(type, ifaceTypes); - if (interfaceTypeIndex < 0) { - faultList.add(new Fault(FuncFaultType.INTERFACE_TYPE_DOES_NOT_EXIST, sheetIndex, i)); + if (!type.equals("")) { + int interfaceTypeIndex = ExcelImportHelper.containsABeanCategoryAssignmentName(type, ifaceTypes); + if (interfaceTypeIndex < 0) { + faultList.add(new Fault(FuncFaultType.INTERFACE_TYPE_DOES_NOT_EXIST, sheetIndex, i)); + } } } } @@ -259,14 +261,14 @@ public void validateHeaders() { final int sheetIndex = wb.getSheetIndex(AExcelFuncIO.TEMPLATE_SHEETNAME_HEADER); // Control if we are importing the correct Structural element by comparing UUIDs - String tempUUID = Objects.toString(sheet.getRow(AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENTUUID).getCell(1), ""); + String tempUUID = Objects.toString(sheet.getRow(AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENT_UUID).getCell(1), ""); if (!(importSei.getUuid().toString().equals(tempUUID))) { - faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_UUIDS_DO_NOT_MATCH, sheetIndex, AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENTUUID)); + faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_UUIDS_DO_NOT_MATCH, sheetIndex, AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENT_UUID)); } // Control if we are importing the correct Structural element by comparing NAMEs - String tempName = Objects.toString(sheet.getRow(AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENTNAME).getCell(1), ""); + String tempName = Objects.toString(sheet.getRow(AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENT_NAME).getCell(1), ""); if (!(importSei.getName().toString().equals(tempName))) { - faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_NAMES_DO_NOT_MATCH, sheetIndex, AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENTNAME)); + faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_NAMES_DO_NOT_MATCH, sheetIndex, AExcelFuncIO.HEADER_ROW_STRUCTURALELEMENT_NAME)); } } } diff --git a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/html/ExportHelper.java b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/html/ExportHelper.java index 6d5bd6647f..59c169994f 100644 --- a/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/html/ExportHelper.java +++ b/de.dlr.sc.virsat.model.extension.funcelectrical/src/de/dlr/sc/virsat/model/extension/funcelectrical/html/ExportHelper.java @@ -36,10 +36,9 @@ public class ExportHelper { public static final String TYPE = ".htm"; public static final String INDEX = "index" + TYPE; - public static final String TARGETFOLDER = "\\resources"; - public static final String RESOURCEFOLDER = "/resources"; - public static final String PRINTERLOGO = "PrinterLogo.png"; - public static final String PROJECTLOGO = "ProjectLogo.png"; + public static final String RESOURCEFOLDER = File.separatorChar + "resources"; + public static final String PRINTERLOGO = RESOURCEFOLDER + File.separatorChar + "PrinterLogo.png"; + public static final String PROJECTLOGO = RESOURCEFOLDER + File.separatorChar + "ProjectLogo.png"; /** * Method to export interface end and interface tables for all the selected structural element instances @@ -53,7 +52,7 @@ public void exportSubHtmlPages(StructuralElementInstance sc, File f, List seiInterfaces = bCaHelper.getAllBeanCategories(sc, Interface.class); List seiInterfaceEnds = bCaHelper.getAllBeanCategories(sc, InterfaceEnd.class); List seiInterfaceTypes = bCaHelper.getAllBeanCategories(sc, InterfaceType.class); @@ -79,19 +78,20 @@ public void export(StructuralElementInstance sc, String path) { HTMLExporter htmlExporter = new HTMLExporter(); try { // Create resources folder - File resources = new File(path + TARGETFOLDER); + String resourceFolderPath = path + RESOURCEFOLDER; + File resources = new File(resourceFolderPath); if (resources.exists()) { resources.delete(); } resources.mkdir(); // Copy necessary files into the folder - copyFile(path + TARGETFOLDER + "\\" + PROJECTLOGO, RESOURCEFOLDER + "/" + PROJECTLOGO); - copyFile(path + TARGETFOLDER + "\\" + PRINTERLOGO, RESOURCEFOLDER + "/" + PRINTERLOGO); + copyFile(path + PROJECTLOGO, PROJECTLOGO); + copyFile(path + PRINTERLOGO, PRINTERLOGO); // Export Block Diagrams ImageProvider ip = new ImageProvider(); - ip.exportImage(path + TARGETFOLDER, sc); + ip.exportImage(resourceFolderPath, sc); // Export html pages for leaf elements exportSubHtmlPages(sc, resources, ip.getSeiLinks()); diff --git a/de.dlr.sc.virsat.model.extension.maturity.feature/feature.xml b/de.dlr.sc.virsat.model.extension.maturity.feature/feature.xml index e0d432efae..66db4e4df5 100644 --- a/de.dlr.sc.virsat.model.extension.maturity.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.maturity.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.maturity.feature/pom.xml b/de.dlr.sc.virsat.model.extension.maturity.feature/pom.xml index ffb3f94e14..2a18af07a1 100644 --- a/de.dlr.sc.virsat.model.extension.maturity.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.maturity.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.extension.maturity.feature diff --git a/de.dlr.sc.virsat.model.extension.maturity.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.maturity.test/META-INF/MANIFEST.MF index b1fe8f2604..bf200f6abb 100644 --- a/de.dlr.sc.virsat.model.extension.maturity.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.maturity.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Maturity Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.maturity.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.maturity;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.maturity.test/pom.xml b/de.dlr.sc.virsat.model.extension.maturity.test/pom.xml index 10d3fdb7fb..b255a9740a 100644 --- a/de.dlr.sc.virsat.model.extension.maturity.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.maturity.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.maturity.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.maturity.ui/META-INF/MANIFEST.MF index 1655a86e7b..581ca01cbc 100644 --- a/de.dlr.sc.virsat.model.extension.maturity.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.maturity.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Maturity UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.maturity.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.emf.edit, diff --git a/de.dlr.sc.virsat.model.extension.maturity.ui/pom.xml b/de.dlr.sc.virsat.model.extension.maturity.ui/pom.xml index d42277362a..fd74e02c27 100644 --- a/de.dlr.sc.virsat.model.extension.maturity.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.maturity.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.maturity/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.maturity/META-INF/MANIFEST.MF index 3f3577cba7..fb3613bbf1 100644 --- a/de.dlr.sc.virsat.model.extension.maturity/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.maturity/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Maturity Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.maturity;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.maturity/pom.xml b/de.dlr.sc.virsat.model.extension.maturity/pom.xml index bdc89c7034..848cdd0307 100644 --- a/de.dlr.sc.virsat.model.extension.maturity/pom.xml +++ b/de.dlr.sc.virsat.model.extension.maturity/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.maturity/src-gen/de/dlr/sc/virsat/model/extension/maturity/model/AMaturity.java b/de.dlr.sc.virsat.model.extension.maturity/src-gen/de/dlr/sc/virsat/model/extension/maturity/model/AMaturity.java index b72970fdfb..dcffc75f3e 100644 --- a/de.dlr.sc.virsat.model.extension.maturity/src-gen/de/dlr/sc/virsat/model/extension/maturity/model/AMaturity.java +++ b/de.dlr.sc.virsat.model.extension.maturity/src-gen/de/dlr/sc/virsat/model/extension/maturity/model/AMaturity.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import org.eclipse.emf.common.command.Command; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * Category to describe the maturity of a part or product * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AMaturity extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.maturity.Maturity"; @@ -132,6 +138,7 @@ public double getLevelEnum() { return level.getEnumValue(); } + @XmlElement public BeanPropertyEnum getLevelBean() { safeAccessLevel(); return level; @@ -168,6 +175,7 @@ public double getTrlEnum() { return trl.getEnumValue(); } + @XmlElement public BeanPropertyEnum getTrlBean() { safeAccessTrl(); return trl; diff --git a/de.dlr.sc.virsat.model.extension.mechanical.feature/feature.xml b/de.dlr.sc.virsat.model.extension.mechanical.feature/feature.xml index c4f059bfb6..992c051b58 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.mechanical.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.mechanical.feature/pom.xml b/de.dlr.sc.virsat.model.extension.mechanical.feature/pom.xml index bdf48b75b8..1b92973a6b 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.mechanical.feature/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.mechanical.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.mechanical.test/META-INF/MANIFEST.MF index bce78d4fba..607499b624 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.mechanical.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Extension Mechanical Engineering Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.mechanical.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.mechanical;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.mechanical.test/pom.xml b/de.dlr.sc.virsat.model.extension.mechanical.test/pom.xml index 2782b836c7..c9341b6ffd 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.mechanical.test/pom.xml @@ -10,7 +10,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.mechanical.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.mechanical.ui/META-INF/MANIFEST.MF index b907f2250b..6a1a92ad99 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.mechanical.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Extension Mechanical Engineering UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.mechanical.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.mechanical, de.dlr.sc.virsat.model.extension.ps, org.eclipse.ui, diff --git a/de.dlr.sc.virsat.model.extension.mechanical.ui/pom.xml b/de.dlr.sc.virsat.model.extension.mechanical.ui/pom.xml index b985a6274c..af11a54a07 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.mechanical.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.mechanical/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.mechanical/META-INF/MANIFEST.MF index bd520a432f..1d9dd37cfa 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.mechanical/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Extension Mechanical Engineering Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.mechanical;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.mechanical/pom.xml b/de.dlr.sc.virsat.model.extension.mechanical/pom.xml index 29e0d7d975..cf7ddaf13d 100644 --- a/de.dlr.sc.virsat.model.extension.mechanical/pom.xml +++ b/de.dlr.sc.virsat.model.extension.mechanical/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.ps.feature/feature.xml b/de.dlr.sc.virsat.model.extension.ps.feature/feature.xml index 89fea07cc5..bd96784553 100644 --- a/de.dlr.sc.virsat.model.extension.ps.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.ps.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.ps.feature/pom.xml b/de.dlr.sc.virsat.model.extension.ps.feature/pom.xml index ab7ccdfdcf..63e4ab01f2 100644 --- a/de.dlr.sc.virsat.model.extension.ps.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.ps.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.extension.ps.feature diff --git a/de.dlr.sc.virsat.model.extension.ps.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.ps.test/META-INF/MANIFEST.MF index 30a1658a4d..dd62692548 100644 --- a/de.dlr.sc.virsat.model.extension.ps.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.ps.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Product Structure Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.ps.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.ps;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.ps.test/pom.xml b/de.dlr.sc.virsat.model.extension.ps.test/pom.xml index 01344a17a5..795802fac4 100644 --- a/de.dlr.sc.virsat.model.extension.ps.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.ps.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.ps.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.ps.ui/META-INF/MANIFEST.MF index d79c56d70d..af3f101f02 100644 --- a/de.dlr.sc.virsat.model.extension.ps.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.ps.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Product Structure UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.ps.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.ps, org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.ps.ui/pom.xml b/de.dlr.sc.virsat.model.extension.ps.ui/pom.xml index d0e67e4498..7ed9b733ce 100644 --- a/de.dlr.sc.virsat.model.extension.ps.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.ps.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.ps/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.ps/META-INF/MANIFEST.MF index 8f5211398f..3596a44491 100644 --- a/de.dlr.sc.virsat.model.extension.ps/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.ps/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Product Structure Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.ps;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.ps/pom.xml b/de.dlr.sc.virsat.model.extension.ps/pom.xml index 7541c66a8d..c0dea4259e 100644 --- a/de.dlr.sc.virsat.model.extension.ps/pom.xml +++ b/de.dlr.sc.virsat.model.extension.ps/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.ps/src-gen/de/dlr/sc/virsat/model/extension/ps/model/ADocument.java b/de.dlr.sc.virsat.model.extension.ps/src-gen/de/dlr/sc/virsat/model/extension/ps/model/ADocument.java index c205affe95..d1ab386f72 100644 --- a/de.dlr.sc.virsat.model.extension.ps/src-gen/de/dlr/sc/virsat/model/extension/ps/model/ADocument.java +++ b/de.dlr.sc.virsat.model.extension.ps/src-gen/de/dlr/sc/virsat/model/extension/ps/model/ADocument.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.util.URI; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ResourcePropertyInstance; import org.eclipse.emf.edit.domain.EditingDomain; @@ -26,6 +29,7 @@ import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyResource; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -40,6 +44,8 @@ * Category to describe documents such as specifications * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ADocument extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.ps.Document"; @@ -104,6 +110,7 @@ public String getDocumentName() { return documentName.getValue(); } + @XmlElement public BeanPropertyString getDocumentNameBean() { safeAccessDocumentName(); return documentName; @@ -135,6 +142,7 @@ public String getNote() { return note.getValue(); } + @XmlElement public BeanPropertyString getNoteBean() { safeAccessNote(); return note; @@ -166,6 +174,7 @@ public String getUrl() { return url.getValue(); } + @XmlElement public BeanPropertyString getUrlBean() { safeAccessUrl(); return url; @@ -197,6 +206,7 @@ public URI getFile() { return file.getValue(); } + @XmlElement public BeanPropertyResource getFileBean() { safeAccessFile(); return file; diff --git a/de.dlr.sc.virsat.model.extension.requirements.feature/feature.xml b/de.dlr.sc.virsat.model.extension.requirements.feature/feature.xml index 3ca1f19dcf..dd94a7036f 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.requirements.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.requirements.feature/pom.xml b/de.dlr.sc.virsat.model.extension.requirements.feature/pom.xml index a22317f47d..1c1fac2f8f 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.requirements.feature/pom.xml @@ -14,7 +14,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.requirements.test/META-INF/MANIFEST.MF index 71d7437f43..72805cc11f 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.requirements.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Extension Requirements Concept Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.requirements.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.requirements Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/pom.xml b/de.dlr.sc.virsat.model.extension.requirements.test/pom.xml index faf0caa7fe..47efe1ee7d 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.requirements.test/pom.xml @@ -14,7 +14,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/migrator/AMigrator0v3Test.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/migrator/AMigrator0v3Test.java new file mode 100644 index 0000000000..c768ac1820 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/migrator/AMigrator0v3Test.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.migrator; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.ecore.util.EcoreUtil; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +import org.junit.Before; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * Extension for Requirement Specification + * + */ +public abstract class AMigrator0v3Test { + protected Concept conceptMigrateTo; + protected Concept conceptMigrateFromRepository; + protected Concept conceptMigrateFrom; + + @Before + public void setUp() throws Exception { + String conceptXmiPluginPathMigrateTo = "de.dlr.sc.virsat.model.extension.requirements/concept/concept_v0_3.xmi"; + String conceptXmiPluginPathMigrateFrom = "de.dlr.sc.virsat.model.extension.requirements/concept/concept_v0_2.xmi"; + + conceptMigrateTo = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPathMigrateTo); + conceptMigrateFromRepository = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPathMigrateFrom); + conceptMigrateFrom = EcoreUtil.copy(conceptMigrateFromRepository); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ADefaultVerificationTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ADefaultVerificationTest.java new file mode 100644 index 0000000000..bbefcb130c --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ADefaultVerificationTest.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import java.lang.Exception; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ADefaultVerificationTest { + + protected Concept concept; + + @Before + public void setUp() throws Exception { + String conceptXmiPluginPath = "de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi"; + concept = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPath); + } + + @After + public void tearDown() throws Exception { + } + + + // ***************************************************************** + // * Constructor Test Cases + // ***************************************************************** + + @Test + public void testDefaultVerification() { + DefaultVerification testDefaultVerification = new DefaultVerification(); + + assertNull("There is no internal DVLM object", testDefaultVerification.getTypeInstance()); + } + + @Test + public void testDefaultVerificationConcept() { + DefaultVerification testDefaultVerification = new DefaultVerification(concept); + + assertNotNull("There is an internal DVLM object", testDefaultVerification.getATypeInstance()); + } + + @Test + public void testDefaultVerificationCategoryAssignment() { + CategoryAssignment testCa = CategoriesFactory.eINSTANCE.createCategoryAssignment(); + DefaultVerification testDefaultVerification = new DefaultVerification(testCa); + + assertEquals("DVLM object has been set as specified", testCa, testDefaultVerification.getTypeInstance()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AExistenceVerificationTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AExistenceVerificationTest.java new file mode 100644 index 0000000000..dd9a96b702 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AExistenceVerificationTest.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import java.lang.Exception; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AExistenceVerificationTest { + + protected Concept concept; + + @Before + public void setUp() throws Exception { + String conceptXmiPluginPath = "de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi"; + concept = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPath); + } + + @After + public void tearDown() throws Exception { + } + + + // ***************************************************************** + // * Constructor Test Cases + // ***************************************************************** + + @Test + public void testExistenceVerification() { + ExistenceVerification testExistenceVerification = new ExistenceVerification(); + + assertNull("There is no internal DVLM object", testExistenceVerification.getTypeInstance()); + } + + @Test + public void testExistenceVerificationConcept() { + ExistenceVerification testExistenceVerification = new ExistenceVerification(concept); + + assertNotNull("There is an internal DVLM object", testExistenceVerification.getATypeInstance()); + } + + @Test + public void testExistenceVerificationCategoryAssignment() { + CategoryAssignment testCa = CategoriesFactory.eINSTANCE.createCategoryAssignment(); + ExistenceVerification testExistenceVerification = new ExistenceVerification(testCa); + + assertEquals("DVLM object has been set as specified", testCa, testExistenceVerification.getTypeInstance()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTraceTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementLinkTest.java similarity index 79% rename from de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTraceTest.java rename to de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementLinkTest.java index 9b7f34f018..6234e65be5 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTraceTest.java +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementLinkTest.java @@ -40,7 +40,7 @@ * * */ -public abstract class ARequirementTraceTest { +public abstract class ARequirementLinkTest { protected Concept concept; @@ -60,24 +60,24 @@ public void tearDown() throws Exception { // ***************************************************************** @Test - public void testRequirementTrace() { - RequirementTrace testRequirementTrace = new RequirementTrace(); + public void testRequirementLink() { + RequirementLink testRequirementLink = new RequirementLink(); - assertNull("There is no internal DVLM object", testRequirementTrace.getTypeInstance()); + assertNull("There is no internal DVLM object", testRequirementLink.getTypeInstance()); } @Test - public void testRequirementTraceConcept() { - RequirementTrace testRequirementTrace = new RequirementTrace(concept); + public void testRequirementLinkConcept() { + RequirementLink testRequirementLink = new RequirementLink(concept); - assertNotNull("There is an internal DVLM object", testRequirementTrace.getATypeInstance()); + assertNotNull("There is an internal DVLM object", testRequirementLink.getATypeInstance()); } @Test - public void testRequirementTraceCategoryAssignment() { + public void testRequirementLinkCategoryAssignment() { CategoryAssignment testCa = CategoriesFactory.eINSTANCE.createCategoryAssignment(); - RequirementTrace testRequirementTrace = new RequirementTrace(testCa); + RequirementLink testRequirementLink = new RequirementLink(testCa); - assertEquals("DVLM object has been set as specified", testCa, testRequirementTrace.getTypeInstance()); + assertEquals("DVLM object has been set as specified", testCa, testRequirementLink.getTypeInstance()); } } diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationConfigurationTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationConfigurationTest.java new file mode 100644 index 0000000000..85e2e4b0a8 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationConfigurationTest.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import java.lang.Exception; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AVerificationConfigurationTest { + + protected Concept concept; + + @Before + public void setUp() throws Exception { + String conceptXmiPluginPath = "de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi"; + concept = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPath); + } + + @After + public void tearDown() throws Exception { + } + + + // ***************************************************************** + // * Constructor Test Cases + // ***************************************************************** + + @Test + public void testVerificationConfiguration() { + VerificationConfiguration testVerificationConfiguration = new VerificationConfiguration(); + + assertNull("There is no internal DVLM object", testVerificationConfiguration.getTypeInstance()); + } + + @Test + public void testVerificationConfigurationConcept() { + VerificationConfiguration testVerificationConfiguration = new VerificationConfiguration(concept); + + assertNotNull("There is an internal DVLM object", testVerificationConfiguration.getATypeInstance()); + } + + @Test + public void testVerificationConfigurationCategoryAssignment() { + CategoryAssignment testCa = CategoriesFactory.eINSTANCE.createCategoryAssignment(); + VerificationConfiguration testVerificationConfiguration = new VerificationConfiguration(testCa); + + assertEquals("DVLM object has been set as specified", testCa, testVerificationConfiguration.getTypeInstance()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationTypeTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationTypeTest.java new file mode 100644 index 0000000000..711d3ad7b7 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationTypeTest.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import java.lang.Exception; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AVerificationTypeTest { + + protected Concept concept; + + @Before + public void setUp() throws Exception { + String conceptXmiPluginPath = "de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi"; + concept = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPath); + } + + @After + public void tearDown() throws Exception { + } + + + // ***************************************************************** + // * Constructor Test Cases + // ***************************************************************** + + @Test + public void testVerificationType() { + VerificationType testVerificationType = new VerificationType(); + + assertNull("There is no internal DVLM object", testVerificationType.getTypeInstance()); + } + + @Test + public void testVerificationTypeConcept() { + VerificationType testVerificationType = new VerificationType(concept); + + assertNotNull("There is an internal DVLM object", testVerificationType.getATypeInstance()); + } + + @Test + public void testVerificationTypeCategoryAssignment() { + CategoryAssignment testCa = CategoriesFactory.eINSTANCE.createCategoryAssignment(); + VerificationType testVerificationType = new VerificationType(testCa); + + assertEquals("DVLM object has been set as specified", testCa, testVerificationType.getTypeInstance()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/test/AllTestsGen.java b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/test/AllTestsGen.java index 990f8f91dc..c6dd784722 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/test/AllTestsGen.java +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src-gen/de/dlr/sc/virsat/model/extension/requirements/test/AllTestsGen.java @@ -21,18 +21,23 @@ import de.dlr.sc.virsat.model.extension.requirements.model.RequirementGroupTest; import de.dlr.sc.virsat.model.extension.requirements.migrator.Migrator0v1Test; +import de.dlr.sc.virsat.model.extension.requirements.model.VerificationTypeTest; import de.dlr.sc.virsat.model.extension.requirements.model.EnumerationLiteralTest; +import de.dlr.sc.virsat.model.extension.requirements.model.DefaultVerificationTest; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementsConfigurationCollectionTest; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementTypeTest; +import de.dlr.sc.virsat.model.extension.requirements.model.RequirementLinkTest; import de.dlr.sc.virsat.model.extension.requirements.migrator.Migrator0v2Test; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementAttributeTest; +import de.dlr.sc.virsat.model.extension.requirements.model.VerificationConfigurationTest; import de.dlr.sc.virsat.model.extension.requirements.model.AttributeValueTest; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementTest; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementsSpecificationTest; import de.dlr.sc.virsat.model.extension.requirements.validator.RequirementsValidatorTest; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementsConfigurationTest; +import de.dlr.sc.virsat.model.extension.requirements.migrator.Migrator0v3Test; import de.dlr.sc.virsat.model.extension.requirements.model.EnumerationDefinitionTest; -import de.dlr.sc.virsat.model.extension.requirements.model.RequirementTraceTest; +import de.dlr.sc.virsat.model.extension.requirements.model.ExistenceVerificationTest; /** * @@ -42,17 +47,22 @@ @SuiteClasses({ RequirementsSpecificationTest.class, RequirementsConfigurationTest.class, + VerificationConfigurationTest.class, RequirementGroupTest.class, RequirementTest.class, - RequirementTraceTest.class, + RequirementLinkTest.class, AttributeValueTest.class, RequirementTypeTest.class, RequirementAttributeTest.class, EnumerationDefinitionTest.class, EnumerationLiteralTest.class, + DefaultVerificationTest.class, + VerificationTypeTest.class, + ExistenceVerificationTest.class, RequirementsConfigurationCollectionTest.class, Migrator0v1Test.class, Migrator0v2Test.class, + Migrator0v3Test.class, RequirementsValidatorTest.class, }) diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/migrator/Migrator0v3Test.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/migrator/Migrator0v3Test.java new file mode 100644 index 0000000000..5225e782fc --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/migrator/Migrator0v3Test.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.migrator; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + +import de.dlr.sc.virsat.model.dvlm.DVLMFactory; +import de.dlr.sc.virsat.model.dvlm.Repository; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +import org.junit.Test; + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * Extension for Requirement Specification + * + */ +public class Migrator0v3Test extends AMigrator0v3Test { + + @Test + public void testMigrator0v3() { + Migrator0v3 testMigrator0v3 = new Migrator0v3(); + + Repository repository = DVLMFactory.eINSTANCE.createRepository(); + repository.getActiveConcepts().add(conceptMigrateFromRepository); + + + testMigrator0v3.migrate(conceptMigrateFrom, conceptMigrateFromRepository, conceptMigrateTo); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerificationEditingDomainTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerificationEditingDomainTest.java new file mode 100644 index 0000000000..decd81d733 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerificationEditingDomainTest.java @@ -0,0 +1,63 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +import static org.junit.Assert.assertEquals; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.command.Command; +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.concept.unittest.util.test.AConceptProjectTestCase; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class DefaultVerificationEditingDomainTest extends AConceptProjectTestCase { + + public static final String TYPE_NAME = "DType"; + private Concept concept = null; + + @Before + public void setUp() throws CoreException { + super.setUp(); + super.addEditingDomainAndRepository(); + String conceptXmiPluginPath = "de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi"; + concept = de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader.loadConceptFromPlugin(conceptXmiPluginPath); + } + + @Test + public void testSetVerificationTypeWithEditingDomain() { + VerificationType type = new VerificationType(concept); + type.setName(TYPE_NAME); + DefaultVerification verification = new DefaultVerification(concept); + Command resultCommand = verification.setVerificationType(editingDomain, type); + editingDomain.getCommandStack().execute(resultCommand); + + assertEquals("Type name should be added to verification isntance", TYPE_NAME, verification.getName()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerificationTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerificationTest.java new file mode 100644 index 0000000000..d0efbd22fd --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerificationTest.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class DefaultVerificationTest extends ADefaultVerificationTest { + + public static final String TYPE_NAME = "DType"; + + @Test + public void testSetVerificationType() { + VerificationType type = new VerificationType(concept); + type.setName(TYPE_NAME); + DefaultVerification verification = new DefaultVerification(concept); + + verification.setVerificationType(type); + + assertEquals("Type name should be added to verification isntance", TYPE_NAME, verification.getName()); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/ExistenceVerificationTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/ExistenceVerificationTest.java new file mode 100644 index 0000000000..7cd2ea2344 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/ExistenceVerificationTest.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class ExistenceVerificationTest extends AExistenceVerificationTest { + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementLinkTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementLinkTest.java new file mode 100644 index 0000000000..e996c4fe75 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementLinkTest.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class RequirementLinkTest extends ARequirementLinkTest { + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationConfigurationTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationConfigurationTest.java new file mode 100644 index 0000000000..9224bd0e7d --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationConfigurationTest.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** + + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class VerificationConfigurationTest extends AVerificationConfigurationTest { + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementTraceTest.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationTypeTest.java similarity index 91% rename from de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementTraceTest.java rename to de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationTypeTest.java index 659d855782..9bba2e28e5 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementTraceTest.java +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationTypeTest.java @@ -27,6 +27,6 @@ * * */ -public class RequirementTraceTest extends ARequirementTraceTest { +public class VerificationTypeTest extends AVerificationTypeTest { } diff --git a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/test/AllTests.java b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/test/AllTests.java index 640c580051..5d519db9b5 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/test/AllTests.java +++ b/de.dlr.sc.virsat.model.extension.requirements.test/src/de/dlr/sc/virsat/model/extension/requirements/test/AllTests.java @@ -20,6 +20,7 @@ import de.dlr.sc.virsat.model.extension.requirements.command.InitializeRequirementCommandTest; import de.dlr.sc.virsat.model.extension.requirements.csv.CsvFileReaderTest; import de.dlr.sc.virsat.model.extension.requirements.csv.RequirementsImporterTest; +import de.dlr.sc.virsat.model.extension.requirements.model.DefaultVerificationEditingDomainTest; import de.dlr.sc.virsat.model.extension.requirements.util.RequirementHelperTest; import junit.framework.JUnit4TestAdapter; @@ -33,7 +34,8 @@ CsvFileReaderTest.class, RequirementsImporterTest.class, InitializeRequirementCommandTest.class, - RequirementHelperTest.class + RequirementHelperTest.class, + DefaultVerificationEditingDomainTest.class, }) /** diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.requirements.ui/META-INF/MANIFEST.MF index 2015f431b8..c9aed72942 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Extension Requirements Concept UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.requirements.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.requirements, org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/plugin.xml b/de.dlr.sc.virsat.model.extension.requirements.ui/plugin.xml index 7227a462fe..5cfc374245 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/plugin.xml +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/plugin.xml @@ -23,6 +23,10 @@ fullQualifiedID="de.dlr.sc.virsat.model.extension.requirements.RequirementsConfiguration" pathToImage="resources/icons/RequirementsConfiguration.gif"> + + @@ -36,8 +40,8 @@ pathToImage="resources/icons/Requirement.gif"> + fullQualifiedID="de.dlr.sc.virsat.model.extension.requirements.RequirementLink" + pathToImage="resources/icons/RequirementLink.gif"> + + + + + + + + + + @@ -73,6 +97,10 @@ id="de.dlr.sc.virsat.model.extension.requirements.ui.command.AddRequirementsConfiguration" name="Add RequirementsConfiguration"> + + @@ -82,8 +110,8 @@ name="Add Requirement"> + id="de.dlr.sc.virsat.model.extension.requirements.ui.command.AddRequirementLink" + name="Add RequirementLink"> + + + + + + @@ -121,6 +161,11 @@ disabledIcon="resources/icons/RequirementsConfiguration_disabled.gif" icon="resources/icons/RequirementsConfiguration.gif"> + + + commandId="de.dlr.sc.virsat.model.extension.requirements.ui.command.AddRequirementLink" + disabledIcon="resources/icons/RequirementLink_disabled.gif" + icon="resources/icons/RequirementLink.gif"> + + + + + + + + @@ -185,8 +249,8 @@ commandId="de.dlr.sc.virsat.model.extension.requirements.ui.command.AddRequirement"> + class="de.dlr.sc.virsat.model.extension.requirements.ui.handler.AddRequirementLinkHandler" + commandId="de.dlr.sc.virsat.model.extension.requirements.ui.command.AddRequirementLink"> + + + + + + @@ -301,6 +377,28 @@ + + + + + + + + + + + + @@ -346,7 +444,7 @@ @@ -477,6 +575,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -543,9 +707,9 @@ snippet="de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetTableRequirementsSpecificationRequirementsRequirement"> + snippet="de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetTableRequirementsSpecificationLinksRequirementLink"> + + + + + + + + + + + snippet="de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetTableRequirementLink"> + snippet="de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetSectionRequirementLink"> + snippet="de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetTableRequirementLinkTargets"> + + + + + + + + + + + + + + + + + + + + + + + + de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/DefaultVerification.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/DefaultVerification.gif new file mode 100644 index 0000000000..82a6950cfc Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/DefaultVerification.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/DefaultVerification_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/DefaultVerification_disabled.gif new file mode 100644 index 0000000000..82a6950cfc Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/DefaultVerification_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ExistenceVerification.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ExistenceVerification.gif new file mode 100644 index 0000000000..0d1d1f7288 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ExistenceVerification.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ExistenceVerification_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ExistenceVerification_disabled.gif new file mode 100644 index 0000000000..0d1d1f7288 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ExistenceVerification_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/IVerification.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/IVerification.gif new file mode 100644 index 0000000000..c414fe9f72 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/IVerification.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/IVerification_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/IVerification_disabled.gif new file mode 100644 index 0000000000..c414fe9f72 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/IVerification_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ModelVerification.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ModelVerification.gif new file mode 100644 index 0000000000..0d1d1f7288 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ModelVerification.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ModelVerification_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ModelVerification_disabled.gif new file mode 100644 index 0000000000..0d1d1f7288 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/ModelVerification_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/RequirementLink.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/RequirementLink.gif new file mode 100644 index 0000000000..aa82bb409b Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/RequirementLink.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/RequirementLink_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/RequirementLink_disabled.gif new file mode 100644 index 0000000000..aa82bb409b Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/RequirementLink_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationConfiguration.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationConfiguration.gif new file mode 100644 index 0000000000..4296308c65 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationConfiguration.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationConfiguration_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationConfiguration_disabled.gif new file mode 100644 index 0000000000..4296308c65 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationConfiguration_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationType.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationType.gif new file mode 100644 index 0000000000..05bf91fe74 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationType.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationType_disabled.gif b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationType_disabled.gif new file mode 100644 index 0000000000..05bf91fe74 Binary files /dev/null and b/de.dlr.sc.virsat.model.extension.requirements.ui/resources/icons/VerificationType_disabled.gif differ diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementLinksCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementLinksCommand.java new file mode 100644 index 0000000000..bddd73858d --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementLinksCommand.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddArrayElementLinksCommand { + + public Command create(EditingDomain editingDomain, ArrayInstance arrayInstance, Category type) { + ATypeInstance ati = new CategoryInstantiator().generateInstance(arrayInstance, type); + return AddCommand.create(editingDomain, arrayInstance, PropertyinstancesPackage.Literals.ARRAY_INSTANCE__ARRAY_INSTANCES, ati); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementTargetsCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementTargetsCommand.java new file mode 100644 index 0000000000..043c53d915 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementTargetsCommand.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddArrayElementTargetsCommand { + + public Command create(EditingDomain editingDomain, ArrayInstance arrayInstance, Category type) { + ATypeInstance ati = new CategoryInstantiator().generateInstance(arrayInstance, type); + return AddCommand.create(editingDomain, arrayInstance, PropertyinstancesPackage.Literals.ARRAY_INSTANCE__ARRAY_INSTANCES, ati); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementVerificationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementVerificationCommand.java new file mode 100644 index 0000000000..c27f8b7166 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementVerificationCommand.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddArrayElementVerificationCommand { + + public Command create(EditingDomain editingDomain, ArrayInstance arrayInstance, Category type) { + ATypeInstance ati = new CategoryInstantiator().generateInstance(arrayInstance, type); + return AddCommand.create(editingDomain, arrayInstance, PropertyinstancesPackage.Literals.ARRAY_INSTANCE__ARRAY_INSTANCES, ati); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementVerificationTypesCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementVerificationTypesCommand.java new file mode 100644 index 0000000000..2afc027842 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddArrayElementVerificationTypesCommand.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddArrayElementVerificationTypesCommand { + + public Command create(EditingDomain editingDomain, ArrayInstance arrayInstance, Category type) { + ATypeInstance ati = new CategoryInstantiator().generateInstance(arrayInstance, type); + return AddCommand.create(editingDomain, arrayInstance, PropertyinstancesPackage.Literals.ARRAY_INSTANCE__ARRAY_INSTANCES, ati); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddDefaultVerificationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddDefaultVerificationCommand.java new file mode 100644 index 0000000000..909c5f4318 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddDefaultVerificationCommand.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesPackage; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import org.eclipse.emf.ecore.EObject; + + +import de.dlr.sc.virsat.model.extension.requirements.model.DefaultVerification; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddDefaultVerificationCommand { + public Command create(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + DefaultVerification conceptObject = new DefaultVerification(activeConcept); + CategoryAssignment ca = conceptObject.getTypeInstance(); + return AddCommand.create(editingDomain, owner, CategoriesPackage.Literals.ICATEGORY_ASSIGNMENT_CONTAINER__CATEGORY_ASSIGNMENTS, ca); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddExistenceVerificationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddExistenceVerificationCommand.java new file mode 100644 index 0000000000..48c9b7da83 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddExistenceVerificationCommand.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesPackage; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import org.eclipse.emf.ecore.EObject; + + +import de.dlr.sc.virsat.model.extension.requirements.model.ExistenceVerification; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddExistenceVerificationCommand { + public Command create(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + ExistenceVerification conceptObject = new ExistenceVerification(activeConcept); + CategoryAssignment ca = conceptObject.getTypeInstance(); + return AddCommand.create(editingDomain, owner, CategoriesPackage.Literals.ICATEGORY_ASSIGNMENT_CONTAINER__CATEGORY_ASSIGNMENTS, ca); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddRequirementTraceCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddRequirementLinkCommand.java similarity index 88% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddRequirementTraceCommand.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddRequirementLinkCommand.java index 6ecbe9a9ac..8921a010cc 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddRequirementTraceCommand.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddRequirementLinkCommand.java @@ -18,7 +18,7 @@ import org.eclipse.emf.ecore.EObject; -import de.dlr.sc.virsat.model.extension.requirements.model.RequirementTrace; +import de.dlr.sc.virsat.model.extension.requirements.model.RequirementLink; /** * Auto Generated Abstract Generator Gap Class @@ -28,9 +28,9 @@ * * */ -public abstract class ACreateAddRequirementTraceCommand { +public abstract class ACreateAddRequirementLinkCommand { public Command create(EditingDomain editingDomain, EObject owner, Concept activeConcept) { - RequirementTrace conceptObject = new RequirementTrace(activeConcept); + RequirementLink conceptObject = new RequirementLink(activeConcept); CategoryAssignment ca = conceptObject.getTypeInstance(); return AddCommand.create(editingDomain, owner, CategoriesPackage.Literals.ICATEGORY_ASSIGNMENT_CONTAINER__CATEGORY_ASSIGNMENTS, ca); } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddVerificationConfigurationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddVerificationConfigurationCommand.java new file mode 100644 index 0000000000..b26187d355 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddVerificationConfigurationCommand.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesPackage; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import org.eclipse.emf.ecore.EObject; + + +import de.dlr.sc.virsat.model.extension.requirements.model.VerificationConfiguration; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddVerificationConfigurationCommand { + public Command create(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + VerificationConfiguration conceptObject = new VerificationConfiguration(activeConcept); + CategoryAssignment ca = conceptObject.getTypeInstance(); + return AddCommand.create(editingDomain, owner, CategoriesPackage.Literals.ICATEGORY_ASSIGNMENT_CONTAINER__CATEGORY_ASSIGNMENTS, ca); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddVerificationTypeCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddVerificationTypeCommand.java new file mode 100644 index 0000000000..273fe598f6 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/command/ACreateAddVerificationTypeCommand.java @@ -0,0 +1,37 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesPackage; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import org.eclipse.emf.ecore.EObject; + + +import de.dlr.sc.virsat.model.extension.requirements.model.VerificationType; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ACreateAddVerificationTypeCommand { + public Command create(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + VerificationType conceptObject = new VerificationType(activeConcept); + CategoryAssignment ca = conceptObject.getTypeInstance(); + return AddCommand.create(editingDomain, owner, CategoriesPackage.Literals.ICATEGORY_ASSIGNMENT_CONTAINER__CATEGORY_ASSIGNMENTS, ca); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddDefaultVerificationHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddDefaultVerificationHandler.java new file mode 100644 index 0000000000..acab21db62 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddDefaultVerificationHandler.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; + +import de.dlr.sc.virsat.project.ui.transactional.handler.ATransactionalAddCategoryHandler; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddDefaultVerificationCommand; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AAddDefaultVerificationHandler extends ATransactionalAddCategoryHandler { + + @Override + protected String getConceptName() { + return "de.dlr.sc.virsat.model.extension.requirements"; + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + return new CreateAddDefaultVerificationCommand().create(editingDomain, owner, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddExistenceVerificationHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddExistenceVerificationHandler.java new file mode 100644 index 0000000000..55bb4d1a54 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddExistenceVerificationHandler.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; + +import de.dlr.sc.virsat.project.ui.transactional.handler.ATransactionalAddCategoryHandler; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddExistenceVerificationCommand; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AAddExistenceVerificationHandler extends ATransactionalAddCategoryHandler { + + @Override + protected String getConceptName() { + return "de.dlr.sc.virsat.model.extension.requirements"; + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + return new CreateAddExistenceVerificationCommand().create(editingDomain, owner, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddRequirementLinkHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddRequirementLinkHandler.java new file mode 100644 index 0000000000..63f1ed8960 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddRequirementLinkHandler.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; + +import de.dlr.sc.virsat.project.ui.transactional.handler.ATransactionalAddCategoryHandler; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddRequirementLinkCommand; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AAddRequirementLinkHandler extends ATransactionalAddCategoryHandler { + + @Override + protected String getConceptName() { + return "de.dlr.sc.virsat.model.extension.requirements"; + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + return new CreateAddRequirementLinkCommand().create(editingDomain, owner, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddVerificationConfigurationHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddVerificationConfigurationHandler.java new file mode 100644 index 0000000000..669464e9e2 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddVerificationConfigurationHandler.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; + +import de.dlr.sc.virsat.project.ui.transactional.handler.ATransactionalAddCategoryHandler; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddVerificationConfigurationCommand; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AAddVerificationConfigurationHandler extends ATransactionalAddCategoryHandler { + + @Override + protected String getConceptName() { + return "de.dlr.sc.virsat.model.extension.requirements"; + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + return new CreateAddVerificationConfigurationCommand().create(editingDomain, owner, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddRequirementTraceHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddVerificationTypeHandler.java similarity index 86% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddRequirementTraceHandler.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddVerificationTypeHandler.java index f4b8a067f4..2dad0b5b97 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddRequirementTraceHandler.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AAddVerificationTypeHandler.java @@ -15,7 +15,7 @@ import org.eclipse.emf.ecore.EObject; import de.dlr.sc.virsat.project.ui.transactional.handler.ATransactionalAddCategoryHandler; -import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddRequirementTraceCommand; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddVerificationTypeCommand; /** * Auto Generated Abstract Generator Gap Class @@ -25,7 +25,7 @@ * * */ -public abstract class AAddRequirementTraceHandler extends ATransactionalAddCategoryHandler { +public abstract class AAddVerificationTypeHandler extends ATransactionalAddCategoryHandler { @Override protected String getConceptName() { @@ -34,6 +34,6 @@ protected String getConceptName() { @Override protected Command createAddCommand(EditingDomain editingDomain, EObject owner, Concept activeConcept) { - return new CreateAddRequirementTraceCommand().create(editingDomain, owner, activeConcept); + return new CreateAddVerificationTypeCommand().create(editingDomain, owner, activeConcept); } } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionDefaultVerification.java new file mode 100644 index 0000000000..64ad9a0819 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionDefaultVerification.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericPropertyInstances; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetSectionDefaultVerification extends AUiSnippetGenericPropertyInstances implements IUiSnippet { + public AUiSnippetSectionDefaultVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", "DefaultVerification"); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionExistenceVerification.java new file mode 100644 index 0000000000..4bd00d4a40 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionExistenceVerification.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericPropertyInstances; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetSectionExistenceVerification extends AUiSnippetGenericPropertyInstances implements IUiSnippet { + public AUiSnippetSectionExistenceVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", "ExistenceVerification"); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionRequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionRequirementLink.java new file mode 100644 index 0000000000..bd44176f51 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionRequirementLink.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericPropertyInstances; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetSectionRequirementLink extends AUiSnippetGenericPropertyInstances implements IUiSnippet { + public AUiSnippetSectionRequirementLink() { + super("de.dlr.sc.virsat.model.extension.requirements", "RequirementLink"); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionVerificationConfiguration.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionVerificationConfiguration.java new file mode 100644 index 0000000000..18891e3b5b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionVerificationConfiguration.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericPropertyInstances; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetSectionVerificationConfiguration extends AUiSnippetGenericPropertyInstances implements IUiSnippet { + public AUiSnippetSectionVerificationConfiguration() { + super("de.dlr.sc.virsat.model.extension.requirements", "VerificationConfiguration"); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionVerificationType.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionVerificationType.java new file mode 100644 index 0000000000..ccc9a0900a --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetSectionVerificationType.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericPropertyInstances; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetSectionVerificationType extends AUiSnippetGenericPropertyInstances implements IUiSnippet { + public AUiSnippetSectionVerificationType() { + super("de.dlr.sc.virsat.model.extension.requirements", "VerificationType"); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableDefaultVerification.java new file mode 100644 index 0000000000..99731d3782 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableDefaultVerification.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddDefaultVerificationCommand; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericCategoryAssignmentTable; + +; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableDefaultVerification extends AUiSnippetGenericCategoryAssignmentTable implements IUiSnippet { + public AUiSnippetTableDefaultVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", + "DefaultVerification", + "de.dlr.sc.virsat.model.extension.requirements.DefaultVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddDefaultVerificationCommand().create(editingDomain, model, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableExistenceVerification.java new file mode 100644 index 0000000000..281b947fb3 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableExistenceVerification.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddExistenceVerificationCommand; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericCategoryAssignmentTable; + +; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableExistenceVerification extends AUiSnippetGenericCategoryAssignmentTable implements IUiSnippet { + public AUiSnippetTableExistenceVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", + "ExistenceVerification", + "de.dlr.sc.virsat.model.extension.requirements.ExistenceVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddExistenceVerificationCommand().create(editingDomain, model, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableExistenceVerificationTarget.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableExistenceVerificationTarget.java new file mode 100644 index 0000000000..48f31acefb --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableExistenceVerificationTarget.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstancePropertyTable; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementTargetCommand; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableExistenceVerificationTarget extends AUiSnippetArrayInstancePropertyTable implements IUiSnippet { + + public AUiSnippetTableExistenceVerificationTarget() { + super("de.dlr.sc.virsat.model.extension.requirements", + "target", + "ExistenceVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementTargetCommand().create(editingDomain, getArrayInstance(model), null); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementLink.java new file mode 100644 index 0000000000..93a6dd2094 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementLink.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddRequirementLinkCommand; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericCategoryAssignmentTable; + +; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableRequirementLink extends AUiSnippetGenericCategoryAssignmentTable implements IUiSnippet { + public AUiSnippetTableRequirementLink() { + super("de.dlr.sc.virsat.model.extension.requirements", + "RequirementLink", + "de.dlr.sc.virsat.model.extension.requirements.RequirementLink", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddRequirementLinkCommand().create(editingDomain, model, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementLinkTargets.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementLinkTargets.java new file mode 100644 index 0000000000..5d10ec64dd --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementLinkTargets.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstancePropertyTable; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementTargetsCommand; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableRequirementLinkTargets extends AUiSnippetArrayInstancePropertyTable implements IUiSnippet { + + public AUiSnippetTableRequirementLinkTargets() { + super("de.dlr.sc.virsat.model.extension.requirements", + "targets", + "RequirementLink", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementTargetsCommand().create(editingDomain, getArrayInstance(model), null); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementVerificationDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementVerificationDefaultVerification.java new file mode 100644 index 0000000000..d0fb6a8010 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementVerificationDefaultVerification.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementVerificationCommand; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstanceCategoryTable; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableRequirementVerificationDefaultVerification extends AUiSnippetArrayInstanceCategoryTable implements IUiSnippet { + + public AUiSnippetTableRequirementVerificationDefaultVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", + "DefaultVerification", + "verification", + "Requirement", + "de.dlr.sc.virsat.model.extension.requirements.DefaultVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementVerificationCommand().create(editingDomain, getArrayInstance(model), ActiveConceptHelper.getCategory(activeConcept, "DefaultVerification")); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementVerificationExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementVerificationExistenceVerification.java new file mode 100644 index 0000000000..ce22bf3b64 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementVerificationExistenceVerification.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementVerificationCommand; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstanceCategoryTable; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableRequirementVerificationExistenceVerification extends AUiSnippetArrayInstanceCategoryTable implements IUiSnippet { + + public AUiSnippetTableRequirementVerificationExistenceVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", + "ExistenceVerification", + "verification", + "Requirement", + "de.dlr.sc.virsat.model.extension.requirements.ExistenceVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementVerificationCommand().create(editingDomain, getArrayInstance(model), ActiveConceptHelper.getCategory(activeConcept, "ExistenceVerification")); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementsSpecificationLinksRequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementsSpecificationLinksRequirementLink.java new file mode 100644 index 0000000000..5f1618d56b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementsSpecificationLinksRequirementLink.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementLinksCommand; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstanceCategoryTable; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableRequirementsSpecificationLinksRequirementLink extends AUiSnippetArrayInstanceCategoryTable implements IUiSnippet { + + public AUiSnippetTableRequirementsSpecificationLinksRequirementLink() { + super("de.dlr.sc.virsat.model.extension.requirements", + "RequirementLink", + "links", + "RequirementsSpecification", + "de.dlr.sc.virsat.model.extension.requirements.RequirementLink", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementLinksCommand().create(editingDomain, getArrayInstance(model), ActiveConceptHelper.getCategory(activeConcept, "RequirementLink")); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfiguration.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfiguration.java new file mode 100644 index 0000000000..0aac8969b0 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfiguration.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericCategoryAssignmentTable; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddVerificationConfigurationCommand; + +; + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableVerificationConfiguration extends AUiSnippetGenericCategoryAssignmentTable implements IUiSnippet { + public AUiSnippetTableVerificationConfiguration() { + super("de.dlr.sc.virsat.model.extension.requirements", + "VerificationConfiguration", + "de.dlr.sc.virsat.model.extension.requirements.VerificationConfiguration", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddVerificationConfigurationCommand().create(editingDomain, model, activeConcept); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification.java new file mode 100644 index 0000000000..e04a43a129 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementVerificationTypesCommand; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstanceCategoryTable; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification extends AUiSnippetArrayInstanceCategoryTable implements IUiSnippet { + + public AUiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", + "DefaultVerification", + "verificationTypes", + "VerificationConfiguration", + "de.dlr.sc.virsat.model.extension.requirements.DefaultVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementVerificationTypesCommand().create(editingDomain, getArrayInstance(model), ActiveConceptHelper.getCategory(activeConcept, "DefaultVerification")); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification.java new file mode 100644 index 0000000000..d6af487a51 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementVerificationTypesCommand; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstanceCategoryTable; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification extends AUiSnippetArrayInstanceCategoryTable implements IUiSnippet { + + public AUiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification() { + super("de.dlr.sc.virsat.model.extension.requirements", + "ExistenceVerification", + "verificationTypes", + "VerificationConfiguration", + "de.dlr.sc.virsat.model.extension.requirements.ExistenceVerification", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementVerificationTypesCommand().create(editingDomain, getArrayInstance(model), ActiveConceptHelper.getCategory(activeConcept, "ExistenceVerification")); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesVerificationType.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesVerificationType.java new file mode 100644 index 0000000000..98c241ccba --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationConfigurationVerificationTypesVerificationType.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddArrayElementVerificationTypesCommand; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetArrayInstanceCategoryTable; + + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AUiSnippetTableVerificationConfigurationVerificationTypesVerificationType extends AUiSnippetArrayInstanceCategoryTable implements IUiSnippet { + + public AUiSnippetTableVerificationConfigurationVerificationTypesVerificationType() { + super("de.dlr.sc.virsat.model.extension.requirements", + "VerificationType", + "verificationTypes", + "VerificationConfiguration", + "de.dlr.sc.virsat.model.extension.requirements.VerificationType", + STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); + } + + @Override + protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { + return new CreateAddArrayElementVerificationTypesCommand().create(editingDomain, getArrayInstance(model), ActiveConceptHelper.getCategory(activeConcept, "VerificationType")); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementTrace.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationType.java similarity index 80% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementTrace.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationType.java index 06ae1eeda8..5f6884ec95 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableRequirementTrace.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src-gen/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/AUiSnippetTableVerificationType.java @@ -10,11 +10,11 @@ package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; -import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddRequirementTraceCommand; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; import de.dlr.sc.virsat.uiengine.ui.editor.snippets.AUiSnippetGenericCategoryAssignmentTable; +import de.dlr.sc.virsat.model.extension.requirements.ui.command.CreateAddVerificationTypeCommand; ; @@ -26,16 +26,16 @@ * * */ -public abstract class AUiSnippetTableRequirementTrace extends AUiSnippetGenericCategoryAssignmentTable implements IUiSnippet { - public AUiSnippetTableRequirementTrace() { +public abstract class AUiSnippetTableVerificationType extends AUiSnippetGenericCategoryAssignmentTable implements IUiSnippet { + public AUiSnippetTableVerificationType() { super("de.dlr.sc.virsat.model.extension.requirements", - "RequirementTrace", - "de.dlr.sc.virsat.model.extension.requirements.RequirementTrace", + "VerificationType", + "de.dlr.sc.virsat.model.extension.requirements.VerificationType", STYLE_ADD_BUTTON | STYLE_REMOVE_BUTTON | STYLE_EDITOR_BUTTON); } @Override protected Command createAddCommand(EditingDomain editingDomain, Concept activeConcept) { - return new CreateAddRequirementTraceCommand().create(editingDomain, model, activeConcept); + return new CreateAddVerificationTypeCommand().create(editingDomain, model, activeConcept); } } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/DefaultVerificationTypeReferenceCellEditingSupport.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/DefaultVerificationTypeReferenceCellEditingSupport.java new file mode 100644 index 0000000000..a08dff3cd3 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/DefaultVerificationTypeReferenceCellEditingSupport.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.celleditor; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.jface.viewers.ColumnViewer; + +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.ReferenceProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; +import de.dlr.sc.virsat.model.extension.requirements.model.DefaultVerification; +import de.dlr.sc.virsat.model.extension.requirements.model.VerificationType; +import de.dlr.sc.virsat.uiengine.ui.cellEditor.aproperties.ReferencePropertyCellEditingSupport; + +/** + * Class simply using bean setters for default verification type + * + */ +public class DefaultVerificationTypeReferenceCellEditingSupport extends ReferencePropertyCellEditingSupport { + + /** + * @param editingDomain + * @param viewer + * @param property + */ + public DefaultVerificationTypeReferenceCellEditingSupport(EditingDomain editingDomain, ColumnViewer viewer, + ReferenceProperty property) { + super(editingDomain, viewer, property); + } + + @Override + protected Command createSetCommand(Object element, Object userInputValue) { + // Checking the element + CategoryAssignment caDefaultVerification = null; + if (element instanceof CategoryAssignment) { + caDefaultVerification = (CategoryAssignment) element; + } else if (element instanceof ComposedPropertyInstance) { + caDefaultVerification = ((ComposedPropertyInstance) element).getTypeInstance(); + } else { + return super.createSetCommand(element, userInputValue); + } + + // Checking the user input + if (userInputValue instanceof CategoryAssignment + && ((CategoryAssignment) userInputValue).getType().getFullQualifiedName().equals(VerificationType.FULL_QUALIFIED_CATEGORY_NAME) + && caDefaultVerification.getType().getFullQualifiedName().equals(DefaultVerification.FULL_QUALIFIED_CATEGORY_NAME)) { + return new DefaultVerification(caDefaultVerification).setVerificationType(editingDomain, new VerificationType((CategoryAssignment) userInputValue)); + } else { + return super.createSetCommand(element, userInputValue); + } + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/RequirementTraceEditingSupport.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/ExisitenceVerificationTargetEditingSupport.java similarity index 79% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/RequirementTraceEditingSupport.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/ExisitenceVerificationTargetEditingSupport.java index 14f691605e..934b7cb6ab 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/RequirementTraceEditingSupport.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/celleditor/ExisitenceVerificationTargetEditingSupport.java @@ -21,21 +21,20 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.widgets.FormToolkit; -import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.AProperty; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.APropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; -import de.dlr.sc.virsat.model.extension.requirements.model.Requirement; -import de.dlr.sc.virsat.model.extension.requirements.ui.snippet.dialog.RequirementsTraceEditingDialog; +import de.dlr.sc.virsat.model.extension.requirements.model.ExistenceVerification; +import de.dlr.sc.virsat.model.extension.requirements.ui.snippet.dialog.ExistenceVerificationTargetEditingDialog; import de.dlr.sc.virsat.project.editingDomain.VirSatEditingDomainRegistry; import de.dlr.sc.virsat.uiengine.ui.cellEditor.aproperties.APropertyCellEditingSupport; /** - * Implements a customized editing support for requirement trace elements + * Implements a customized editing support for selecting the target of an existence editing support * */ -public class RequirementTraceEditingSupport extends APropertyCellEditingSupport { +public class ExisitenceVerificationTargetEditingSupport extends APropertyCellEditingSupport { protected FormToolkit toolkit; @@ -45,7 +44,7 @@ public class RequirementTraceEditingSupport extends APropertyCellEditingSupport * @param viewer the table viewer * @param property an aproperty */ - public RequirementTraceEditingSupport(EditingDomain editingDomain, ColumnViewer viewer, AProperty property, FormToolkit toolkit) { + public ExisitenceVerificationTargetEditingSupport(EditingDomain editingDomain, ColumnViewer viewer, AProperty property, FormToolkit toolkit) { super(editingDomain, viewer, property); this.toolkit = toolkit; } @@ -54,15 +53,15 @@ public RequirementTraceEditingSupport(EditingDomain editingDomain, ColumnViewer protected CellEditor getCellEditor(Object element) { if (element instanceof ComposedPropertyInstance) { - Requirement req = new Requirement(((ComposedPropertyInstance) element).getTypeInstance()); - final CategoryAssignment referencedTypeInstance = req.getTrace().getTypeInstance(); + ExistenceVerification verification = new ExistenceVerification(((ComposedPropertyInstance) element).getTypeInstance()); + final CategoryAssignment referencedTypeInstance = verification.getTypeInstance(); editor = new DialogCellEditor((Composite) viewer.getControl()) { @Override protected Object openDialogBox(Control cellEditorWindow) { EditingDomain editingDomain = VirSatEditingDomainRegistry.INSTANCE.getEd(referencedTypeInstance); if (referencedTypeInstance != null) { - Dialog dialog = new RequirementsTraceEditingDialog( + Dialog dialog = new ExistenceVerificationTargetEditingDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), toolkit, editingDomain, referencedTypeInstance); if (dialog.open() == Dialog.OK) { @@ -93,8 +92,7 @@ protected Button createButton(final Composite parent) { @Override protected Object getValue(Object element) { APropertyInstance propertyInstance = getPropertyInstance(element); - ATypeInstance value = ((ComposedPropertyInstance) propertyInstance).getTypeInstance(); - return value; + return propertyInstance; } @Override @@ -109,8 +107,8 @@ protected boolean canEdit(Object element) { @Override protected void setValue(Object element, Object userInputValue) { - // Overwriting super method because this method is not actually changing any value, its just - // forwarding the editing capabilities and thus does not net to execute any set command + // Overwriting super method because this method is not actually changing any value, it's just + // forwarding the editing capabilities and thus does not need to execute any set command viewer.update(element, null); } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementLinksCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementLinksCommand.java new file mode 100644 index 0000000000..d70f9b3a2f --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementLinksCommand.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddArrayElementLinksCommand extends ACreateAddArrayElementLinksCommand { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementTargetsCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementTargetsCommand.java new file mode 100644 index 0000000000..331bb22fd5 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementTargetsCommand.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddArrayElementTargetsCommand extends ACreateAddArrayElementTargetsCommand { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementVerificationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementVerificationCommand.java new file mode 100644 index 0000000000..4f748cd9cf --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementVerificationCommand.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.command.AddCommand; +import org.eclipse.emf.edit.domain.EditingDomain; + +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddArrayElementVerificationCommand extends ACreateAddArrayElementVerificationCommand { + + @Override + public Command create(EditingDomain editingDomain, ArrayInstance arrayInstance, Category type) { + ATypeInstance ati = new CategoryInstantiator().generateInstance(arrayInstance, type); + ((ComposedPropertyInstance) ati).getTypeInstance().setName(type.getName()); + return AddCommand.create(editingDomain, arrayInstance, PropertyinstancesPackage.Literals.ARRAY_INSTANCE__ARRAY_INSTANCES, ati); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementVerificationTypesCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementVerificationTypesCommand.java new file mode 100644 index 0000000000..ec29c6b111 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddArrayElementVerificationTypesCommand.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddArrayElementVerificationTypesCommand extends ACreateAddArrayElementVerificationTypesCommand { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddDefaultVerificationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddDefaultVerificationCommand.java new file mode 100644 index 0000000000..b5c8a39f8e --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddDefaultVerificationCommand.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddDefaultVerificationCommand extends ACreateAddDefaultVerificationCommand { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddExistenceVerificationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddExistenceVerificationCommand.java new file mode 100644 index 0000000000..35011459ed --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddExistenceVerificationCommand.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.edit.command.AddCommand; +import org.eclipse.emf.edit.domain.EditingDomain; + +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.extension.requirements.model.ExistenceVerification; + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddExistenceVerificationCommand extends ACreateAddExistenceVerificationCommand { + + @Override + public Command create(EditingDomain editingDomain, EObject owner, Concept activeConcept) { + ExistenceVerification conceptObject = new ExistenceVerification(activeConcept); + conceptObject.setName(ExistenceVerification.class.getName()); + CategoryAssignment ca = conceptObject.getTypeInstance(); + return AddCommand.create(editingDomain, owner, CategoriesPackage.Literals.ICATEGORY_ASSIGNMENT_CONTAINER__CATEGORY_ASSIGNMENTS, ca); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddRequirementTraceCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddRequirementLinkCommand.java similarity index 86% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddRequirementTraceCommand.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddRequirementLinkCommand.java index 71bf1efb6b..7f2a6b0bc9 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddRequirementTraceCommand.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddRequirementLinkCommand.java @@ -18,5 +18,5 @@ * * */ -public class CreateAddRequirementTraceCommand extends ACreateAddRequirementTraceCommand { +public class CreateAddRequirementLinkCommand extends ACreateAddRequirementLinkCommand { } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddVerificationConfigurationCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddVerificationConfigurationCommand.java new file mode 100644 index 0000000000..84fc1835ce --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddVerificationConfigurationCommand.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddVerificationConfigurationCommand extends ACreateAddVerificationConfigurationCommand { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddVerificationTypeCommand.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddVerificationTypeCommand.java new file mode 100644 index 0000000000..d433513947 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/command/CreateAddVerificationTypeCommand.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.command; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class CreateAddVerificationTypeCommand extends ACreateAddVerificationTypeCommand { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddDefaultVerificationHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddDefaultVerificationHandler.java new file mode 100644 index 0000000000..be8727a85d --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddDefaultVerificationHandler.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class AddDefaultVerificationHandler extends AAddDefaultVerificationHandler { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddExistenceVerificationHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddExistenceVerificationHandler.java new file mode 100644 index 0000000000..774b92147c --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddExistenceVerificationHandler.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class AddExistenceVerificationHandler extends AAddExistenceVerificationHandler { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddRequirementTraceHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddRequirementLinkHandler.java similarity index 87% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddRequirementTraceHandler.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddRequirementLinkHandler.java index 691984e75e..6e8d0ecd07 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddRequirementTraceHandler.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddRequirementLinkHandler.java @@ -18,5 +18,5 @@ * * */ -public class AddRequirementTraceHandler extends AAddRequirementTraceHandler { +public class AddRequirementLinkHandler extends AAddRequirementLinkHandler { } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddVerificationConfigurationHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddVerificationConfigurationHandler.java new file mode 100644 index 0000000000..274f8109ea --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddVerificationConfigurationHandler.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class AddVerificationConfigurationHandler extends AAddVerificationConfigurationHandler { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddVerificationTypeHandler.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddVerificationTypeHandler.java new file mode 100644 index 0000000000..3d6d66e575 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/handler/AddVerificationTypeHandler.java @@ -0,0 +1,22 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.handler; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class AddVerificationTypeHandler extends AAddVerificationTypeHandler { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeDefinitionTableLabelProvider.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeDefinitionTableLabelProvider.java index d5156e60d4..afbe5eda2b 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeDefinitionTableLabelProvider.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeDefinitionTableLabelProvider.java @@ -10,6 +10,7 @@ package de.dlr.sc.virsat.model.extension.requirements.ui.provider; import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.swt.graphics.Image; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; @@ -66,6 +67,14 @@ public String getColumnText(Object object, int columnIndex) { return ((IName) object).getName(); } + @Override + public Image getColumnImage(final Object object, final int columnIndex) { + if (object instanceof ComposedPropertyInstance) { + return super.getColumnImage(((ComposedPropertyInstance) object).getType(), columnIndex); + } + return super.getColumnImage(object, columnIndex); + } + /** * Show type value of the attribute * @param attDef the attribute definition diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeLabelProvider.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeLabelProvider.java index 636250c5f9..b41ee79e6c 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeLabelProvider.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/provider/RequirementsAttributeLabelProvider.java @@ -23,9 +23,9 @@ import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.APropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.util.PropertyInstanceValueSwitch; import de.dlr.sc.virsat.model.extension.requirements.model.AttributeValue; +import de.dlr.sc.virsat.model.extension.requirements.model.IVerification; import de.dlr.sc.virsat.model.extension.requirements.model.Requirement; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementAttribute; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementType; @@ -94,7 +94,7 @@ public String getColumnText(Object object, int columnIndex) { ATypeInstance ti = valueSwitch.doSwitch(propertyInstance); redirectNotification(ti, object); - return getTraceLabel(new Requirement(ca)); + return getVerificationLabel(new Requirement(ca)); } else if (columnIndex > STATUS_COLUMN) { @@ -202,28 +202,22 @@ protected void cleanUpAttribue(AttributeValue att) { } /** - * Create a label for requirements traces customized to this table + * Create a label for requirements verification methods customized to this table * - * @param req the requirement for which a trace label is created - * @return the trace label + * @param req the requirement for which a verification method label is created + * @return the label */ - protected String getTraceLabel(Requirement req) { - if (req.getTrace().getTarget() == null || req.getTrace().getTarget().isEmpty()) { + protected String getVerificationLabel(Requirement req) { + if (req.getVerification().isEmpty()) { return EMPTY_TRACE_STRING; } else { - List traceStringArtifacts = new ArrayList(); - - // Some heavy casting necessary because Bean GenericCategory is abstract - APropertyInstance targetProperty = req.getTrace().getTypeInstance().getPropertyInstances() - .get(REQUIREMENT_TRACE_TARGET_PROPERTY_NUMBER); - for (APropertyInstance targetRPI : ((ArrayInstance) targetProperty).getArrayInstances()) { - CategoryAssignment target = (CategoryAssignment) ((ReferencePropertyInstance) targetRPI) - .getReference(); - if (target != null) { - traceStringArtifacts.add(target.getName()); - } + List verificationStringArtifacts = new ArrayList(); + + for (IVerification verification : req.getVerification()) { + verificationStringArtifacts.add(verification.getName()); } - return "{" + String.join(", ", traceStringArtifacts) + "}"; + + return "{" + String.join(", ", verificationStringArtifacts) + "}"; } } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetCustomRequirementsAttributeTable.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetCustomRequirementsAttributeTable.java index 7af8335297..4d1c131ab9 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetCustomRequirementsAttributeTable.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetCustomRequirementsAttributeTable.java @@ -56,7 +56,6 @@ import de.dlr.sc.virsat.model.extension.requirements.model.RequirementType; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementsConfigurationCollection; import de.dlr.sc.virsat.model.extension.requirements.ui.Activator; -import de.dlr.sc.virsat.model.extension.requirements.ui.celleditor.RequirementTraceEditingSupport; import de.dlr.sc.virsat.model.extension.requirements.ui.celleditor.RequirementsAttributeValuePerColumnEditingSupport; import de.dlr.sc.virsat.model.extension.requirements.ui.provider.RequirementsAttributeLabelProvider; import de.dlr.sc.virsat.project.ui.labelProvider.VirSatTransactionalAdapterFactoryLabelProvider; @@ -74,13 +73,14 @@ public abstract class UiSnippetCustomRequirementsAttributeTable extends AUiSnipp protected static final String COLUMN_TEXT_STATUS = "Status"; protected static final String COLUMN_ATTRIBUTE_SEPARATOR = " / "; - protected static final String COLUMN_TEXT_TRACE = "Trace"; + protected static final String COLUMN_TEXT_VERIFICATION = "Verification"; protected static final String FQN_PROPERTY_REQUIREMENT_TYPE = Requirement.FULL_QUALIFIED_CATEGORY_NAME + "." + Requirement.PROPERTY_REQTYPE; private static final int TABLE_HIGHT = 500; private static final int STATUS_COLUMN_WIDTH = 100; private static final int TRACE_COLUMN_WIDTH = 100; + private static final int FIXED_COLUMNS_NUMBER = 2; // status + verification column private static final String COLUMN_PREFIX = "attColumn"; protected final String arrayInstanceID; @@ -89,7 +89,7 @@ public abstract class UiSnippetCustomRequirementsAttributeTable extends AUiSnipp protected int maxNumberAttributes = 0; protected TableViewerColumn colStatus = null; - protected TableViewerColumn colTracing = null; + protected TableViewerColumn colValidation = null; protected List attColumns; protected boolean controlListenerActive = true; @@ -128,18 +128,18 @@ protected void createTableColumns(EditingDomain editingDomain) { .get(RequirementsAttributeLabelProvider.REQUIREMENT_STATUS_PROPERTY_NUMBER))); colStatus.getColumn().setWidth(STATUS_COLUMN_WIDTH); - + colStatus.getColumn().addControlListener(this); // initialize list for attribute column attColumns = new ArrayList<>(); + attColumns.add(colStatus); } - if (colTracing == null) { - colTracing = (TableViewerColumn) createDefaultColumn(COLUMN_TEXT_TRACE); - - colTracing.setEditingSupport(new RequirementTraceEditingSupport(editingDomain, columnViewer, categoryModel.getProperties() - .get(RequirementsAttributeLabelProvider.REQUIREMENT_TRACE_PROPERTY_NUMBER), toolkit)); + if (colValidation == null) { + colValidation = (TableViewerColumn) createDefaultColumn(COLUMN_TEXT_VERIFICATION); - colTracing.getColumn().setWidth(TRACE_COLUMN_WIDTH); + colValidation.getColumn().setWidth(TRACE_COLUMN_WIDTH); + colValidation.getColumn().addControlListener(this); + attColumns.add(colValidation); } @@ -167,6 +167,7 @@ protected void createTableColumns(EditingDomain editingDomain) { // Add necessary table columns for (int i = 0; i < maxNumberAttributes; i++) { + int tableIndexColumn = i + FIXED_COLUMNS_NUMBER; StringBuilder columnName = new StringBuilder(); for (RequirementType requirementType : requirementTypes) { @@ -185,8 +186,8 @@ protected void createTableColumns(EditingDomain editingDomain) { } } - if (attColumns.size() > i) { - attColumns.get(i).getColumn().setText(columnName.toString()); + if (attColumns.size() > tableIndexColumn) { + attColumns.get(tableIndexColumn).getColumn().setText(columnName.toString()); } else { TableViewerColumn newColumn = (TableViewerColumn) createDefaultColumn(columnName.toString()); newColumn.getColumn().addControlListener(this); diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionDefaultVerification.java new file mode 100644 index 0000000000..0ed3ca34f4 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionDefaultVerification.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetSectionDefaultVerification extends AUiSnippetSectionDefaultVerification implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionExistenceVerification.java new file mode 100644 index 0000000000..f0ff639d6a --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionExistenceVerification.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetSectionExistenceVerification extends AUiSnippetSectionExistenceVerification implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirement.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirement.java index 1f65046d17..be56267a1e 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirement.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirement.java @@ -44,7 +44,7 @@ import de.dlr.sc.virsat.model.extension.requirements.model.AttributeValue; import de.dlr.sc.virsat.model.extension.requirements.model.Requirement; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementType; -import de.dlr.sc.virsat.model.extension.requirements.ui.snippet.dialog.RequirementsTraceEditingDialog; +import de.dlr.sc.virsat.model.extension.requirements.ui.snippet.dialog.ExistenceVerificationTargetEditingDialog; import de.dlr.sc.virsat.project.editingDomain.VirSatEditingDomainRegistry; import de.dlr.sc.virsat.uiengine.ui.dialog.ReferenceSelectionDialog; import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; @@ -91,7 +91,7 @@ public void widgetDefaultSelected(SelectionEvent e) { EditingDomain editingDomain = VirSatEditingDomainRegistry.INSTANCE.getEd(referencedTypeInstance); if (referencedTypeInstance != null) { - Dialog dialog = new RequirementsTraceEditingDialog( + Dialog dialog = new ExistenceVerificationTargetEditingDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), toolkit, editingDomain, referencedTypeInstance); dialog.open(); diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirementLink.java new file mode 100644 index 0000000000..54e5679518 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionRequirementLink.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetSectionRequirementLink extends AUiSnippetSectionRequirementLink implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionVerificationConfiguration.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionVerificationConfiguration.java new file mode 100644 index 0000000000..e2dcfb62fe --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionVerificationConfiguration.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetSectionVerificationConfiguration extends AUiSnippetSectionVerificationConfiguration implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionVerificationType.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionVerificationType.java new file mode 100644 index 0000000000..d677ca70b5 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetSectionVerificationType.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetSectionVerificationType extends AUiSnippetSectionVerificationType implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableDefaultVerification.java new file mode 100644 index 0000000000..32bf70a69a --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableDefaultVerification.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableDefaultVerification extends AUiSnippetTableDefaultVerification { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableExistenceVerification.java new file mode 100644 index 0000000000..e8a8dee8e5 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableExistenceVerification.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableExistenceVerification extends AUiSnippetTableExistenceVerification { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableExistenceVerificationTarget.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableExistenceVerificationTarget.java new file mode 100644 index 0000000000..ea9a0ed115 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableExistenceVerificationTarget.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableExistenceVerificationTarget extends AUiSnippetTableExistenceVerificationTarget implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementElementsAttributeValue.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementElementsAttributeValue.java index 54779c6278..0aae4aefd6 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementElementsAttributeValue.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementElementsAttributeValue.java @@ -15,13 +15,18 @@ import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; import org.eclipse.ui.forms.widgets.FormToolkit; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.AProperty; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.APropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; import de.dlr.sc.virsat.model.extension.requirements.model.AttributeValue; +import de.dlr.sc.virsat.model.extension.requirements.model.Requirement; import de.dlr.sc.virsat.model.extension.requirements.model.RequirementAttribute; import de.dlr.sc.virsat.model.extension.requirements.ui.celleditor.RequirementsAttributeValueEditingSupport; import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; @@ -39,6 +44,10 @@ public class UiSnippetTableRequirementElementsAttributeValue extends AUiSnippetT private static final String VALUE_PROPERTY_NAME = "value"; private static final int VALUE_COLUMN_SIZE = 700; + private static final int TABLE_HIGHT = 400; + private static final int COLUMN_HIGHT = 30; + private static final String SECTION_HEADING = "Requirement Attributes"; + private static final String SECTION_DESCRIPTION = "Specify the different requirment attributes as defined in its type."; /** * Constructor for this editor snippet @@ -93,7 +102,21 @@ public int compare(Viewer viewer, Object e1, Object e2) { } }); } - + + @Override + protected Table createDefaultTable(FormToolkit toolkit, Composite sectionBody) { + int numberAtts = new Requirement(((CategoryAssignment) model)).getElements().size(); + Table table = super.createDefaultTable(toolkit, sectionBody); + GridData gridDataTable = (GridData) table.getLayoutData(); + gridDataTable.heightHint = Math.min(COLUMN_HIGHT * numberAtts, TABLE_HIGHT); + return table; + } + + @Override + public Composite createSectionBody(FormToolkit toolkit, String sectionHeading, String sectionDescription, + int numberColumns) { + return super.createSectionBody(toolkit, SECTION_HEADING, SECTION_DESCRIPTION, numberColumns); + } @Override protected List getTableObjects() { diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementTrace.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementLink.java similarity index 88% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementTrace.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementLink.java index 22caa760eb..03f20468c7 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementTrace.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementLink.java @@ -22,5 +22,5 @@ * * */ -public class UiSnippetTableRequirementTrace extends AUiSnippetTableRequirementTrace { +public class UiSnippetTableRequirementLink extends AUiSnippetTableRequirementLink { } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementLinkTargets.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementLinkTargets.java new file mode 100644 index 0000000000..743fcd6783 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementLinkTargets.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableRequirementLinkTargets extends AUiSnippetTableRequirementLinkTargets implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementVerificationDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementVerificationDefaultVerification.java new file mode 100644 index 0000000000..18fc96e7c2 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementVerificationDefaultVerification.java @@ -0,0 +1,173 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import java.util.Collection; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.viewers.EditingSupport; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Table; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import de.dlr.sc.virsat.model.dvlm.Repository; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeDefinition; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.AProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.ReferenceProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryAssignmentHelper; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.structural.StructuralElementInstance; +import de.dlr.sc.virsat.model.extension.requirements.model.DefaultVerification; +import de.dlr.sc.virsat.model.extension.requirements.model.RequirementsConfigurationCollection; +import de.dlr.sc.virsat.model.extension.requirements.model.VerificationType; +import de.dlr.sc.virsat.model.extension.requirements.ui.celleditor.DefaultVerificationTypeReferenceCellEditingSupport; +import de.dlr.sc.virsat.uiengine.ui.cellEditor.aproperties.PropertyInstanceEditingSupportFactory; +import de.dlr.sc.virsat.uiengine.ui.dialog.ReferenceSelectionDialog; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableRequirementVerificationDefaultVerification extends AUiSnippetTableRequirementVerificationDefaultVerification implements IUiSnippet { + + private static final int TABLE_HIGHT = 80; + private static final String SECTION_HEADING = "Basic Verification Method"; + private static final String SECTION_DESCRIPTION = "Select a verification method from the verification configuration."; + private static final String DIALOG_DESCRIPTION = "Select a Verification Method"; + public static final String BUTTON_ADD_TEXT = "Add Verification Type"; + + @Override + protected EditingSupport createEditingSupport(EditingDomain editingDomain, AProperty property) { + + if (property instanceof ReferenceProperty) { + return new DefaultVerificationTypeReferenceCellEditingSupport(editingDomain, columnViewer, (ReferenceProperty) property); + } + + return PropertyInstanceEditingSupportFactory.INSTANCE.createEditingSupportFor(editingDomain, columnViewer, property); + } + + @Override + protected Table createDefaultTable(FormToolkit toolkit, Composite sectionBody) { + Table table = super.createDefaultTable(toolkit, sectionBody); + GridData gridDataTable = (GridData) table.getLayoutData(); + gridDataTable.heightHint = TABLE_HIGHT; + return table; + } + + @Override + public Composite createSectionBody(FormToolkit toolkit, String sectionHeading, String sectionDescription, + int numberColumns) { + return super.createSectionBody(toolkit, SECTION_HEADING, SECTION_DESCRIPTION, numberColumns); + } + + /** + * this method creates the add button and his functionality + * + * @param toolkit the toolkit to be used to create the button + * @param editingDomain the editing domain an which the button might act on + * @param compositeButtons the composite in which the button should be placed + */ + protected void createAddButton(FormToolkit toolkit, EditingDomain editingDomain, Composite compositeButtons) { + if ((style & STYLE_ADD_BUTTON) != 0) { + Button buttonAdd = toolkit.createButton(compositeButtons, BUTTON_ADD_TEXT, SWT.PUSH); + buttonAdd.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(SelectionEvent e) { + ATypeDefinition referencePropertyType = acHelper.getCategory(conceptId, VerificationType.FULL_QUALIFIED_CATEGORY_NAME); + createAddVerificationDialog(editingDomain, + referencePropertyType); + } + + @Override + public void widgetDefaultSelected(SelectionEvent e) { + widgetSelected(e); + } + }); + checkWriteAccess(buttonAdd); + } + } + + /** + * @param editingDomain the editing domain of the new verification method + * @param affectedObjects affected elements of the add operation + * @param arrayInstance the array instance of the verification table + * @param newVerification the new verification method + * @param referencePropertyType the property type of the verification method + */ + protected void createAddVerificationDialog(EditingDomain editingDomain, + ATypeDefinition referencePropertyType) { + + // Configure dialog + ReferenceSelectionDialog dialog = ReferenceSelectionDialog.createRefernceSelectionDialog( + Display.getCurrent().getActiveShell(), referencePropertyType, adapterFactory); + dialog.setInput(model.eResource()); + StructuralElementInstance firstConfiguration = getFirstRootSeiInRepo(RequirementsConfigurationCollection.FULL_QUALIFIED_STRUCTURAL_ELEMENT_NAME, + CategoryAssignmentHelper.getRepository((CategoryAssignment) model)); + dialog.setInitialSelection(firstConfiguration); + dialog.setAllowMultiple(false); + dialog.setDoubleClickSelects(true); + dialog.setTitle(DIALOG_DESCRIPTION); + + if (dialog.open() == Dialog.OK) { + // Add a new verification method as first step + Concept activeConcept = acHelper.getConcept(conceptId); + Command addCommand = createAddCommand(editingDomain, activeConcept); + editingDomain.getCommandStack().execute(addCommand); + Collection affectedObjects = addCommand.getAffectedObjects(); + ComposedPropertyInstance arrayInstance = (ComposedPropertyInstance) affectedObjects.iterator().next(); + CategoryAssignment newVerification = arrayInstance.getTypeInstance(); + + // If a proper type was selected, then also set this type as verification type + // If non was selected, then leave the type area empty for later + Object selection = dialog.getFirstResult(); + if (selection instanceof CategoryAssignment) { + initializeVerificationMethod(editingDomain, new DefaultVerification(newVerification), new VerificationType((CategoryAssignment) selection)); + } + } + } + + /** + * Return the first SEI of a specific type from our project repository root entities + * + * @param fqn The full qualified name of the SEI to be returned + * @param repo the repository to be searched in + * @return the SEI + */ + protected StructuralElementInstance getFirstRootSeiInRepo(String fqn, Repository repo) { + for (StructuralElementInstance sei : repo.getRootEntities()) { + if (sei.getType().getFullQualifiedName().equals(fqn)) { + return sei; + } + } + return null; + } + + protected void initializeVerificationMethod(EditingDomain editingDomain, DefaultVerification verification, VerificationType type) { + editingDomain.getCommandStack().execute(verification.setVerificationType(editingDomain, type)); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementVerificationExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementVerificationExistenceVerification.java new file mode 100644 index 0000000000..7c508da428 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementVerificationExistenceVerification.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.jface.viewers.EditingSupport; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Table; +import org.eclipse.ui.forms.widgets.FormToolkit; + +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.AProperty; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.ReferenceProperty; +import de.dlr.sc.virsat.model.extension.requirements.ui.celleditor.ExisitenceVerificationTargetEditingSupport; +import de.dlr.sc.virsat.uiengine.ui.cellEditor.aproperties.PropertyInstanceEditingSupportFactory; +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableRequirementVerificationExistenceVerification extends AUiSnippetTableRequirementVerificationExistenceVerification implements IUiSnippet { + + private static final int TABLE_HIGHT = 80; + private static final String SECTION_HEADING = "System Model Existence Verification"; + private static final String SECTION_DESCRIPTION = "Verificication method to ensure that a particular system model element is created."; + + @Override + protected EditingSupport createEditingSupport(EditingDomain editingDomain, AProperty property) { + + if (property instanceof ReferenceProperty) { + return new ExisitenceVerificationTargetEditingSupport(editingDomain, columnViewer, (ReferenceProperty) property, toolkit); + } + + return PropertyInstanceEditingSupportFactory.INSTANCE.createEditingSupportFor(editingDomain, columnViewer, property); + } + + @Override + protected Table createDefaultTable(FormToolkit toolkit, Composite sectionBody) { + Table table = super.createDefaultTable(toolkit, sectionBody); + GridData gridDataTable = (GridData) table.getLayoutData(); + gridDataTable.heightHint = TABLE_HIGHT; + return table; + } + + @Override + public Composite createSectionBody(FormToolkit toolkit, String sectionHeading, String sectionDescription, + int numberColumns) { + return super.createSectionBody(toolkit, SECTION_HEADING, SECTION_DESCRIPTION, numberColumns); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementsSpecificationLinksRequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementsSpecificationLinksRequirementLink.java new file mode 100644 index 0000000000..64d1efaa67 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableRequirementsSpecificationLinksRequirementLink.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableRequirementsSpecificationLinksRequirementLink extends AUiSnippetTableRequirementsSpecificationLinksRequirementLink implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfiguration.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfiguration.java new file mode 100644 index 0000000000..b1fff71a52 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfiguration.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableVerificationConfiguration extends AUiSnippetTableVerificationConfiguration { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification.java new file mode 100644 index 0000000000..ab14026bd3 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification extends AUiSnippetTableVerificationConfigurationVerificationTypesDefaultVerification implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification.java new file mode 100644 index 0000000000..b6608d0599 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification extends AUiSnippetTableVerificationConfigurationVerificationTypesExistenceVerification implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesVerificationType.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesVerificationType.java new file mode 100644 index 0000000000..76b110410c --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationConfigurationVerificationTypesVerificationType.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + +import de.dlr.sc.virsat.uiengine.ui.editor.snippets.IUiSnippet; + + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableVerificationConfigurationVerificationTypesVerificationType extends AUiSnippetTableVerificationConfigurationVerificationTypesVerificationType implements IUiSnippet { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationType.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationType.java new file mode 100644 index 0000000000..e54bbb668c --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/UiSnippetTableVerificationType.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class UiSnippetTableVerificationType extends AUiSnippetTableVerificationType { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetCreationDialog.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetCreationDialog.java index 2cff85db21..e5e3ec2dd6 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetCreationDialog.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetCreationDialog.java @@ -9,27 +9,15 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.extension.requirements.ui.snippet.dialog; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.emf.common.command.Command; import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.command.DeleteCommand; import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.jface.dialogs.Dialog; import org.eclipse.swt.widgets.Shell; -import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import de.dlr.sc.virsat.model.concept.types.factory.BeanCategoryAssignmentFactory; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; - /** - * @author fran_tb + * Dialog using editor snippets to add a new model element * */ -public abstract class AUiSnippetCreationDialog extends Dialog { - - protected EditingDomain editingDomain; - protected EObject initModel; +public abstract class AUiSnippetCreationDialog extends AUiSnippetEditDialog { /** * @param parent The shell of the parent element @@ -37,9 +25,7 @@ public abstract class AUiSnippetCreationDialog extends Dialog { * @param initModel the underlying model element */ public AUiSnippetCreationDialog(Shell parent, EditingDomain editingDomain, EObject initModel) { - super(parent); - this.editingDomain = editingDomain; - this.initModel = initModel; + super(parent, editingDomain, initModel); } @@ -49,31 +35,5 @@ protected void cancelPressed() { editingDomain.getCommandStack().execute(getDeleteCommand(initModel)); super.cancelPressed(); } - - - /** - * Create delete command - * @param object the object to be deleted - * @return the command - */ - protected Command getDeleteCommand(EObject object) { - Command deleteCommand; - - BeanCategoryAssignmentFactory beanCaFactory = new BeanCategoryAssignmentFactory(); - if (object instanceof CategoryAssignment || object instanceof ComposedPropertyInstance) { - - CategoryAssignment ca = object instanceof ComposedPropertyInstance ? ((ComposedPropertyInstance) object).getTypeInstance() : (CategoryAssignment) object; - try { - IBeanCategoryAssignment beanCa = beanCaFactory.getInstanceFor(ca); - deleteCommand = beanCa.delete(editingDomain); - } catch (CoreException e) { - deleteCommand = DeleteCommand.create(editingDomain, ca); - } - } else { - - deleteCommand = DeleteCommand.create(editingDomain, object); - } - return deleteCommand; - } } diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetEditDialog.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetEditDialog.java new file mode 100644 index 0000000000..31331b680a --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/AUiSnippetEditDialog.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.ui.snippet.dialog; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.edit.command.DeleteCommand; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.swt.widgets.Shell; + +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.concept.types.factory.BeanCategoryAssignmentFactory; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; + +/** + * Dialog using editor snippets to modify a model element + * + */ +public abstract class AUiSnippetEditDialog extends Dialog { + + protected EditingDomain editingDomain; + protected EObject initModel; + + /** + * @param parent The shell of the parent element + * @param editingDomain the editing domain of the underlying model element + * @param initModel the underlying model element + */ + public AUiSnippetEditDialog(Shell parent, EditingDomain editingDomain, EObject initModel) { + super(parent); + this.editingDomain = editingDomain; + this.initModel = initModel; + } + + + /** + * Create delete command + * @param object the object to be deleted + * @return the command + */ + protected Command getDeleteCommand(EObject object) { + Command deleteCommand; + + BeanCategoryAssignmentFactory beanCaFactory = new BeanCategoryAssignmentFactory(); + if (object instanceof CategoryAssignment || object instanceof ComposedPropertyInstance) { + + CategoryAssignment ca = object instanceof ComposedPropertyInstance ? ((ComposedPropertyInstance) object).getTypeInstance() : (CategoryAssignment) object; + try { + IBeanCategoryAssignment beanCa = beanCaFactory.getInstanceFor(ca); + deleteCommand = beanCa.delete(editingDomain); + } catch (CoreException e) { + + deleteCommand = DeleteCommand.create(editingDomain, ca); + } + } else { + + deleteCommand = DeleteCommand.create(editingDomain, object); + } + return deleteCommand; + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/RequirementsTraceEditingDialog.java b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/ExistenceVerificationTargetEditingDialog.java similarity index 79% rename from de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/RequirementsTraceEditingDialog.java rename to de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/ExistenceVerificationTargetEditingDialog.java index 49f19945cc..f15d853e37 100644 --- a/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/RequirementsTraceEditingDialog.java +++ b/de.dlr.sc.virsat.model.extension.requirements.ui/src/de/dlr/sc/virsat/model/extension/requirements/ui/snippet/dialog/ExistenceVerificationTargetEditingDialog.java @@ -18,22 +18,22 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.forms.widgets.FormToolkit; -import de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetTableRequirementTraceTarget; +import de.dlr.sc.virsat.model.extension.requirements.ui.snippet.UiSnippetTableExistenceVerificationTarget; /** * */ -public class RequirementsTraceEditingDialog extends AUiSnippetCreationDialog { +public class ExistenceVerificationTargetEditingDialog extends AUiSnippetEditDialog { protected FormToolkit toolkit; - protected static final String DIALOG_TITEL = "Requirement Trace Target Selection"; + protected static final String DIALOG_TITEL = "Model Existence Verification Target Selection"; /** * @param parent * @param editingDomain * @param initModel */ - public RequirementsTraceEditingDialog(Shell parent, FormToolkit toolkit, EditingDomain editingDomain, EObject initModel) { + public ExistenceVerificationTargetEditingDialog(Shell parent, FormToolkit toolkit, EditingDomain editingDomain, EObject initModel) { super(parent, editingDomain, initModel); this.toolkit = toolkit; } @@ -55,7 +55,7 @@ protected Control createContents(Composite parent) { // create the dialog area and button bar dialogArea = createDialogArea(composite); - new UiSnippetTableRequirementTraceTarget().createSwt(toolkit, editingDomain, composite, + new UiSnippetTableExistenceVerificationTarget().createSwt(toolkit, editingDomain, composite, initModel); buttonBar = createButtonBar(composite); diff --git a/de.dlr.sc.virsat.model.extension.requirements/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.requirements/META-INF/MANIFEST.MF index 7faeac8558..db066609a3 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.requirements/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Model Extension Requirements Concept Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.requirements;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.requirements/concept/concept.concept b/de.dlr.sc.virsat.model.extension.requirements/concept/concept.concept index 4528bb3234..2efaf47cd2 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/concept/concept.concept +++ b/de.dlr.sc.virsat.model.extension.requirements/concept/concept.concept @@ -7,7 +7,7 @@ * * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ -Concept de.dlr.sc.virsat.model.extension.requirements displayname "Requirements" description "Extension for Requirement Specification" version 0.2 beta +Concept de.dlr.sc.virsat.model.extension.requirements displayname "Requirements" description "Extension for Requirement Specification" version 0.3 beta { StructuralElement RequirementsConfigurationCollection description "Storage for configuration elements of requirements" { @@ -19,7 +19,7 @@ Concept de.dlr.sc.virsat.model.extension.requirements displayname "Requirements" Resource exportFile; Type requirements [] of Category RequirementObject; - Type typeDefinitions [] of Category RequirementType; + Type links [] of Category RequirementLink; } Category RequirementsConfiguration { @@ -28,6 +28,11 @@ Concept de.dlr.sc.virsat.model.extension.requirements displayname "Requirements" Type typeDefinitions [] of Category RequirementType; } + Category VerificationConfiguration { + Applicable For [ RequirementsConfigurationCollection ]; + Type verificationTypes [] of Category VerificationType; + } + Category RequirementObject description "Interface for specification objects" { IsAbstract; } @@ -40,12 +45,13 @@ Concept de.dlr.sc.virsat.model.extension.requirements displayname "Requirements" Reference reqType of Type RequirementType; Type elements [] of Category AttributeValue; EnumProperty status values [Open = 0, FullyCompliant = 1, PartialCompliant = 2, NonCompliant = 3, NotApplicable = 4]; - Type trace of Category RequirementTrace; + Type verification[] of Category IVerification; } - Category RequirementTrace { - Reference target[] of Type GenericCategory; - //Validation type + Category RequirementLink { + EnumProperty type values [DependsOn = 1, Parent = 2]; + Reference subject of Type Requirement; + Reference targets[] of Type Requirement; } Category AttributeValue { @@ -62,10 +68,32 @@ Concept de.dlr.sc.virsat.model.extension.requirements displayname "Requirements" Type enumeration of Category EnumerationDefinition; } + Category EnumerationDefinition { Type literals [] of Category EnumerationLiteral; } Category EnumerationLiteral {} + + Category IVerification { + IsAbstract; + } + + Category DefaultVerification extends IVerification { + Reference verificationType of Type VerificationType; + } + + Category VerificationType { + StringProperty verDescription; + EnumProperty verType values [NotApplicable = 0, Analysis = 1, Inspection = 2, Demonstration = 3, Test = 4]; + } + + Category ModelVerification extends IVerification { + IsAbstract; + } + + Category ExistenceVerification extends ModelVerification { + Reference target[] of Type GenericCategory; + } } diff --git a/de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi b/de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi index 2b3ff24066..fe0b5b2aab 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi +++ b/de.dlr.sc.virsat.model.extension.requirements/concept/concept.xmi @@ -1,12 +1,12 @@ - + - + @@ -18,6 +18,12 @@ + + + + + + @@ -38,12 +44,18 @@ - + + + - - + + + + + + + - @@ -59,7 +71,7 @@ - + @@ -80,5 +92,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/de.dlr.sc.virsat.model.extension.requirements/concept/concept_v0_3.xmi b/de.dlr.sc.virsat.model.extension.requirements/concept/concept_v0_3.xmi new file mode 100644 index 0000000000..fe0b5b2aab --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/concept/concept_v0_3.xmi @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/de.dlr.sc.virsat.model.extension.requirements/plugin.xml b/de.dlr.sc.virsat.model.extension.requirements/plugin.xml index 45ef3a9c0f..edf6214e9f 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/plugin.xml +++ b/de.dlr.sc.virsat.model.extension.requirements/plugin.xml @@ -4,7 +4,7 @@ @@ -25,6 +25,10 @@ id="de.dlr.sc.virsat.model.extension.requirements.RequirementsConfiguration" caBean="de.dlr.sc.virsat.model.extension.requirements.model.RequirementsConfiguration"> + + @@ -34,8 +38,8 @@ caBean="de.dlr.sc.virsat.model.extension.requirements.model.Requirement"> + id="de.dlr.sc.virsat.model.extension.requirements.RequirementLink" + caBean="de.dlr.sc.virsat.model.extension.requirements.model.RequirementLink"> + + + + + + + + + + diff --git a/de.dlr.sc.virsat.model.extension.requirements/pom.xml b/de.dlr.sc.virsat.model.extension.requirements/pom.xml index 968838e242..3b8a078f62 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/pom.xml +++ b/de.dlr.sc.virsat.model.extension.requirements/pom.xml @@ -14,7 +14,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/migrator/AMigrator0v3.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/migrator/AMigrator0v3.java new file mode 100644 index 0000000000..41c08661f7 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/migrator/AMigrator0v3.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.migrator; + +import de.dlr.sc.virsat.model.concept.migrator.AMigrator; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * Extension for Requirement Specification + * + */ +public abstract class AMigrator0v3 extends AMigrator { + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ADefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ADefaultVerification.java new file mode 100644 index 0000000000..e1eae8bd81 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ADefaultVerification.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import org.eclipse.emf.edit.domain.EditingDomain; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ADefaultVerification extends IVerification implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.DefaultVerification"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + public static final String PROPERTY_VERIFICATIONTYPE = "verificationType"; + + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public ADefaultVerification() { + } + + public ADefaultVerification(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "DefaultVerification"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "DefaultVerification"); + setTypeInstance(categoryAssignement); + } + + public ADefaultVerification(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + // ***************************************************************** + // * Attribute: verificationType + // ***************************************************************** + private BeanPropertyReference verificationType = new BeanPropertyReference<>(); + + private void safeAccessVerificationType() { + ReferencePropertyInstance propertyInstance = (ReferencePropertyInstance) helper.getPropertyInstance("verificationType"); + verificationType.setTypeInstance(propertyInstance); + } + + public VerificationType getVerificationType() { + safeAccessVerificationType(); + return verificationType.getValue(); + } + + public Command setVerificationType(EditingDomain ed, VerificationType value) { + safeAccessVerificationType(); + return verificationType.setValue(ed, value); + } + + public void setVerificationType(VerificationType value) { + safeAccessVerificationType(); + verificationType.setValue(value); + } + + public BeanPropertyReference getVerificationTypeBean() { + safeAccessVerificationType(); + return verificationType; + } + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AExistenceVerification.java new file mode 100644 index 0000000000..0aefc1cbfd --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AExistenceVerification.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AExistenceVerification extends ModelVerification implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.ExistenceVerification"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + public static final String PROPERTY_TARGET = "target"; + + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public AExistenceVerification() { + } + + public AExistenceVerification(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "ExistenceVerification"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "ExistenceVerification"); + setTypeInstance(categoryAssignement); + } + + public AExistenceVerification(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + // ***************************************************************** + // * Array Attribute: target + // ***************************************************************** + private IBeanList target = new TypeSafeReferencePropertyInstanceList<>(GenericCategory.class); + + private void safeAccessTarget() { + if (target.getArrayInstance() == null) { + target.setArrayInstance((ArrayInstance) helper.getPropertyInstance("target")); + } + } + + public IBeanList getTarget() { + safeAccessTarget(); + return target; + } + + private IBeanList> targetBean = new TypeSafeReferencePropertyBeanList<>(); + + private void safeAccessTargetBean() { + if (targetBean.getArrayInstance() == null) { + targetBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("target")); + } + } + + public IBeanList> getTargetBean() { + safeAccessTargetBean(); + return targetBean; + } + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AIVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AIVerification.java new file mode 100644 index 0000000000..ef49b4349b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AIVerification.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AIVerification extends GenericCategory implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.IVerification"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public AIVerification() { + } + + public AIVerification(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "IVerification"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "IVerification"); + setTypeInstance(categoryAssignement); + } + + public AIVerification(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AModelVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AModelVerification.java new file mode 100644 index 0000000000..90df2ea9b9 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AModelVerification.java @@ -0,0 +1,70 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AModelVerification extends IVerification implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.ModelVerification"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public AModelVerification() { + } + + public AModelVerification(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "ModelVerification"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "ModelVerification"); + setTypeInstance(categoryAssignement); + } + + public AModelVerification(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirement.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirement.java index 9b1a92c32a..a166112c8d 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirement.java +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirement.java @@ -29,7 +29,6 @@ import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; // ***************************************************************** @@ -60,7 +59,7 @@ public String getFullQualifiedCategoryName() { public static final String PROPERTY_REQTYPE = "reqType"; public static final String PROPERTY_ELEMENTS = "elements"; public static final String PROPERTY_STATUS = "status"; - public static final String PROPERTY_TRACE = "trace"; + public static final String PROPERTY_VERIFICATION = "verification"; // Status enumeration value names public static final String STATUS_Open_NAME = "Open"; @@ -190,25 +189,32 @@ public BeanPropertyEnum getStatusBean() { } // ***************************************************************** - // * Attribute: trace + // * Array Attribute: verification // ***************************************************************** - private BeanPropertyComposed trace = new BeanPropertyComposed<>(); + private IBeanList verification = new TypeSafeComposedPropertyInstanceList<>(IVerification.class); - private void safeAccessTrace() { - if (trace.getTypeInstance() == null) { - ComposedPropertyInstance propertyInstance = (ComposedPropertyInstance) helper.getPropertyInstance("trace"); - trace.setTypeInstance(propertyInstance); + private void safeAccessVerification() { + if (verification.getArrayInstance() == null) { + verification.setArrayInstance((ArrayInstance) helper.getPropertyInstance("verification")); } } - public RequirementTrace getTrace() { - safeAccessTrace(); - return trace.getValue(); + public IBeanList getVerification() { + safeAccessVerification(); + return verification; } - public BeanPropertyComposed getTraceBean() { - safeAccessTrace(); - return trace; + private IBeanList> verificationBean = new TypeSafeComposedPropertyBeanList<>(); + + private void safeAccessVerificationBean() { + if (verificationBean.getArrayInstance() == null) { + verificationBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("verification")); + } + } + + public IBeanList> getVerificationBean() { + safeAccessVerificationBean(); + return verificationBean; } diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementLink.java new file mode 100644 index 0000000000..c4ee24f907 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementLink.java @@ -0,0 +1,185 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; +import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class ARequirementLink extends GenericCategory implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.RequirementLink"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + public static final String PROPERTY_TYPE = "type"; + public static final String PROPERTY_SUBJECT = "subject"; + public static final String PROPERTY_TARGETS = "targets"; + + // Type enumeration value names + public static final String TYPE_DependsOn_NAME = "DependsOn"; + public static final String TYPE_Parent_NAME = "Parent"; + // Type enumeration values + public static final String TYPE_DependsOn_VALUE = "1"; + public static final String TYPE_Parent_VALUE = "2"; + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public ARequirementLink() { + } + + public ARequirementLink(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "RequirementLink"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "RequirementLink"); + setTypeInstance(categoryAssignement); + } + + public ARequirementLink(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + // ***************************************************************** + // * Attribute: type + // ***************************************************************** + private BeanPropertyEnum type = new BeanPropertyEnum(); + + private void safeAccessType() { + if (type.getTypeInstance() == null) { + type.setTypeInstance((EnumUnitPropertyInstance) helper.getPropertyInstance("type")); + } + } + + public Command setType(EditingDomain ed, String value) { + safeAccessType(); + return this.type.setValue(ed, value); + } + + public void setType(String value) { + safeAccessType(); + this.type.setValue(value); + } + + public String getType() { + safeAccessType(); + return type.getValue(); + } + + public double getTypeEnum() { + safeAccessType(); + return type.getEnumValue(); + } + + public BeanPropertyEnum getTypeBean() { + safeAccessType(); + return type; + } + + // ***************************************************************** + // * Attribute: subject + // ***************************************************************** + private BeanPropertyReference subject = new BeanPropertyReference<>(); + + private void safeAccessSubject() { + ReferencePropertyInstance propertyInstance = (ReferencePropertyInstance) helper.getPropertyInstance("subject"); + subject.setTypeInstance(propertyInstance); + } + + public Requirement getSubject() { + safeAccessSubject(); + return subject.getValue(); + } + + public Command setSubject(EditingDomain ed, Requirement value) { + safeAccessSubject(); + return subject.setValue(ed, value); + } + + public void setSubject(Requirement value) { + safeAccessSubject(); + subject.setValue(value); + } + + public BeanPropertyReference getSubjectBean() { + safeAccessSubject(); + return subject; + } + + // ***************************************************************** + // * Array Attribute: targets + // ***************************************************************** + private IBeanList targets = new TypeSafeReferencePropertyInstanceList<>(Requirement.class); + + private void safeAccessTargets() { + if (targets.getArrayInstance() == null) { + targets.setArrayInstance((ArrayInstance) helper.getPropertyInstance("targets")); + } + } + + public IBeanList getTargets() { + safeAccessTargets(); + return targets; + } + + private IBeanList> targetsBean = new TypeSafeReferencePropertyBeanList<>(); + + private void safeAccessTargetsBean() { + if (targetsBean.getArrayInstance() == null) { + targetsBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("targets")); + } + } + + public IBeanList> getTargetsBean() { + safeAccessTargetsBean(); + return targetsBean; + } + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTrace.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTrace.java index 7f2eab9122..2f78075742 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTrace.java +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementTrace.java @@ -12,18 +12,22 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; -import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; -import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyBeanList; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -38,6 +42,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ARequirementTrace extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.RequirementTrace"; @@ -97,6 +103,7 @@ private void safeAccessTargetBean() { } } + @XmlElement public IBeanList> getTargetBean() { safeAccessTargetBean(); return targetBean; diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementsSpecification.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementsSpecification.java index edb76d281a..47e5945b4a 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementsSpecification.java +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/ARequirementsSpecification.java @@ -58,7 +58,7 @@ public String getFullQualifiedCategoryName() { // property name constants public static final String PROPERTY_EXPORTFILE = "exportFile"; public static final String PROPERTY_REQUIREMENTS = "requirements"; - public static final String PROPERTY_TYPEDEFINITIONS = "typeDefinitions"; + public static final String PROPERTY_LINKS = "links"; @@ -141,32 +141,32 @@ public IBeanList> getRequirementsBean() } // ***************************************************************** - // * Array Attribute: typeDefinitions + // * Array Attribute: links // ***************************************************************** - private IBeanList typeDefinitions = new TypeSafeComposedPropertyInstanceList<>(RequirementType.class); + private IBeanList links = new TypeSafeComposedPropertyInstanceList<>(RequirementLink.class); - private void safeAccessTypeDefinitions() { - if (typeDefinitions.getArrayInstance() == null) { - typeDefinitions.setArrayInstance((ArrayInstance) helper.getPropertyInstance("typeDefinitions")); + private void safeAccessLinks() { + if (links.getArrayInstance() == null) { + links.setArrayInstance((ArrayInstance) helper.getPropertyInstance("links")); } } - public IBeanList getTypeDefinitions() { - safeAccessTypeDefinitions(); - return typeDefinitions; + public IBeanList getLinks() { + safeAccessLinks(); + return links; } - private IBeanList> typeDefinitionsBean = new TypeSafeComposedPropertyBeanList<>(); + private IBeanList> linksBean = new TypeSafeComposedPropertyBeanList<>(); - private void safeAccessTypeDefinitionsBean() { - if (typeDefinitionsBean.getArrayInstance() == null) { - typeDefinitionsBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("typeDefinitions")); + private void safeAccessLinksBean() { + if (linksBean.getArrayInstance() == null) { + linksBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("links")); } } - public IBeanList> getTypeDefinitionsBean() { - safeAccessTypeDefinitionsBean(); - return typeDefinitionsBean; + public IBeanList> getLinksBean() { + safeAccessLinksBean(); + return linksBean; } diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationConfiguration.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationConfiguration.java new file mode 100644 index 0000000000..5ecd1ed60c --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationConfiguration.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AVerificationConfiguration extends GenericCategory implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.VerificationConfiguration"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + public static final String PROPERTY_VERIFICATIONTYPES = "verificationTypes"; + + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public AVerificationConfiguration() { + } + + public AVerificationConfiguration(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "VerificationConfiguration"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "VerificationConfiguration"); + setTypeInstance(categoryAssignement); + } + + public AVerificationConfiguration(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + // ***************************************************************** + // * Array Attribute: verificationTypes + // ***************************************************************** + private IBeanList verificationTypes = new TypeSafeComposedPropertyInstanceList<>(VerificationType.class); + + private void safeAccessVerificationTypes() { + if (verificationTypes.getArrayInstance() == null) { + verificationTypes.setArrayInstance((ArrayInstance) helper.getPropertyInstance("verificationTypes")); + } + } + + public IBeanList getVerificationTypes() { + safeAccessVerificationTypes(); + return verificationTypes; + } + + private IBeanList> verificationTypesBean = new TypeSafeComposedPropertyBeanList<>(); + + private void safeAccessVerificationTypesBean() { + if (verificationTypesBean.getArrayInstance() == null) { + verificationTypesBean.setArrayInstance((ArrayInstance) helper.getPropertyInstance("verificationTypes")); + } + } + + public IBeanList> getVerificationTypesBean() { + safeAccessVerificationTypesBean(); + return verificationTypesBean; + } + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationType.java b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationType.java new file mode 100644 index 0000000000..ac0e8fd387 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src-gen/de/dlr/sc/virsat/model/extension/requirements/model/AVerificationType.java @@ -0,0 +1,158 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Abstract Generator Gap Class + * + * Don't Manually modify this class + * + * + * + */ +public abstract class AVerificationType extends GenericCategory implements IBeanCategoryAssignment { + + public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.requirements.VerificationType"; + + /** + * Call this method to get the full qualified name of the underlying category + * @return The FQN of the category as String + */ + public String getFullQualifiedCategoryName() { + return FULL_QUALIFIED_CATEGORY_NAME; + } + + // property name constants + public static final String PROPERTY_VERDESCRIPTION = "verDescription"; + public static final String PROPERTY_VERTYPE = "verType"; + + // VerType enumeration value names + public static final String VERTYPE_NotApplicable_NAME = "NotApplicable"; + public static final String VERTYPE_Analysis_NAME = "Analysis"; + public static final String VERTYPE_Inspection_NAME = "Inspection"; + public static final String VERTYPE_Demonstration_NAME = "Demonstration"; + public static final String VERTYPE_Test_NAME = "Test"; + // VerType enumeration values + public static final String VERTYPE_NotApplicable_VALUE = "0"; + public static final String VERTYPE_Analysis_VALUE = "1"; + public static final String VERTYPE_Inspection_VALUE = "2"; + public static final String VERTYPE_Demonstration_VALUE = "3"; + public static final String VERTYPE_Test_VALUE = "4"; + + + // ***************************************************************** + // * Class Constructors + // ***************************************************************** + + public AVerificationType() { + } + + public AVerificationType(Concept concept) { + Category categoryFromActiveCategories = ActiveConceptHelper.getCategory(concept, "VerificationType"); + CategoryAssignment categoryAssignement = new CategoryInstantiator().generateInstance(categoryFromActiveCategories, "VerificationType"); + setTypeInstance(categoryAssignement); + } + + public AVerificationType(CategoryAssignment categoryAssignement) { + setTypeInstance(categoryAssignement); + } + + + // ***************************************************************** + // * Attribute: verDescription + // ***************************************************************** + private BeanPropertyString verDescription = new BeanPropertyString(); + + private void safeAccessVerDescription() { + if (verDescription.getTypeInstance() == null) { + verDescription.setTypeInstance((ValuePropertyInstance) helper.getPropertyInstance("verDescription")); + } + } + + public Command setVerDescription(EditingDomain ed, String value) { + safeAccessVerDescription(); + return this.verDescription.setValue(ed, value); + } + + public void setVerDescription(String value) { + safeAccessVerDescription(); + this.verDescription.setValue(value); + } + + public String getVerDescription() { + safeAccessVerDescription(); + return verDescription.getValue(); + } + + public BeanPropertyString getVerDescriptionBean() { + safeAccessVerDescription(); + return verDescription; + } + + // ***************************************************************** + // * Attribute: verType + // ***************************************************************** + private BeanPropertyEnum verType = new BeanPropertyEnum(); + + private void safeAccessVerType() { + if (verType.getTypeInstance() == null) { + verType.setTypeInstance((EnumUnitPropertyInstance) helper.getPropertyInstance("verType")); + } + } + + public Command setVerType(EditingDomain ed, String value) { + safeAccessVerType(); + return this.verType.setValue(ed, value); + } + + public void setVerType(String value) { + safeAccessVerType(); + this.verType.setValue(value); + } + + public String getVerType() { + safeAccessVerType(); + return verType.getValue(); + } + + public double getVerTypeEnum() { + safeAccessVerType(); + return verType.getEnumValue(); + } + + public BeanPropertyEnum getVerTypeBean() { + safeAccessVerType(); + return verType; + } + + +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/migrator/Migrator0v3.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/migrator/Migrator0v3.java new file mode 100644 index 0000000000..b73ae472f2 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/migrator/Migrator0v3.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.migrator; + +import de.dlr.sc.virsat.model.concept.migrator.IMigrator; + + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * Extension for Requirement Specification + * + */ +public class Migrator0v3 extends AMigrator0v3 implements IMigrator { +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerification.java new file mode 100644 index 0000000000..1cceff8862 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/DefaultVerification.java @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CompoundCommand; +import org.eclipse.emf.edit.domain.EditingDomain; + +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class DefaultVerification extends ADefaultVerification { + + /** + * Constructor of Concept Class + */ + public DefaultVerification() { + super(); + } + + /** + * Constructor of Concept Class which will instantiate + * a CategoryAssignment in the background from the given concept + * @param concept the concept where it will find the correct Category to instantiate from + */ + public DefaultVerification(Concept concept) { + super(concept); + } + + /** + * Constructor of Concept Class that can be initialized manually by a given Category Assignment + * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean + */ + public DefaultVerification(CategoryAssignment categoryAssignment) { + super(categoryAssignment); + } + + @Override + public Command setVerificationType(EditingDomain ed, VerificationType value) { + CompoundCommand cc = new CompoundCommand(); + cc.append(super.setVerificationType(ed, value)); + cc.append(this.setName(ed, value.getName())); + return cc; + } + + @Override + public void setVerificationType(VerificationType value) { + setName(value.getName()); + super.setVerificationType(value); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/ExistenceVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/ExistenceVerification.java new file mode 100644 index 0000000000..d80de1d76b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/ExistenceVerification.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class ExistenceVerification extends AExistenceVerification { + + /** + * Constructor of Concept Class + */ + public ExistenceVerification() { + super(); + } + + /** + * Constructor of Concept Class which will instantiate + * a CategoryAssignment in the background from the given concept + * @param concept the concept where it will find the correct Category to instantiate from + */ + public ExistenceVerification(Concept concept) { + super(concept); + } + + /** + * Constructor of Concept Class that can be initialized manually by a given Category Assignment + * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean + */ + public ExistenceVerification(CategoryAssignment categoryAssignment) { + super(categoryAssignment); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/IVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/IVerification.java new file mode 100644 index 0000000000..ee2cf9de2d --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/IVerification.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public abstract class IVerification extends AIVerification { + + /** + * Constructor of Concept Class + */ + public IVerification() { + super(); + } + + /** + * Constructor of Concept Class which will instantiate + * a CategoryAssignment in the background from the given concept + * @param concept the concept where it will find the correct Category to instantiate from + */ + public IVerification(Concept concept) { + super(concept); + } + + /** + * Constructor of Concept Class that can be initialized manually by a given Category Assignment + * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean + */ + public IVerification(CategoryAssignment categoryAssignment) { + super(categoryAssignment); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/ModelVerification.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/ModelVerification.java new file mode 100644 index 0000000000..684df5db96 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/ModelVerification.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public abstract class ModelVerification extends AModelVerification { + + /** + * Constructor of Concept Class + */ + public ModelVerification() { + super(); + } + + /** + * Constructor of Concept Class which will instantiate + * a CategoryAssignment in the background from the given concept + * @param concept the concept where it will find the correct Category to instantiate from + */ + public ModelVerification(Concept concept) { + super(concept); + } + + /** + * Constructor of Concept Class that can be initialized manually by a given Category Assignment + * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean + */ + public ModelVerification(CategoryAssignment categoryAssignment) { + super(categoryAssignment); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementLink.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementLink.java new file mode 100644 index 0000000000..2e2faf9e5b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementLink.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class RequirementLink extends ARequirementLink { + + /** + * Constructor of Concept Class + */ + public RequirementLink() { + super(); + } + + /** + * Constructor of Concept Class which will instantiate + * a CategoryAssignment in the background from the given concept + * @param concept the concept where it will find the correct Category to instantiate from + */ + public RequirementLink(Concept concept) { + super(concept); + } + + /** + * Constructor of Concept Class that can be initialized manually by a given Category Assignment + * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean + */ + public RequirementLink(CategoryAssignment categoryAssignment) { + super(categoryAssignment); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationConfiguration.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationConfiguration.java new file mode 100644 index 0000000000..5fb98b4298 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationConfiguration.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.requirements.model; + +// ***************************************************************** +// * Import Statements +// ***************************************************************** +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; + +// ***************************************************************** +// * Class Declaration +// ***************************************************************** + +/** + * Auto Generated Class inheriting from Generator Gap Class + * + * This class is generated once, do your changes here + * + * + * + */ +public class VerificationConfiguration extends AVerificationConfiguration { + + /** + * Constructor of Concept Class + */ + public VerificationConfiguration() { + super(); + } + + /** + * Constructor of Concept Class which will instantiate + * a CategoryAssignment in the background from the given concept + * @param concept the concept where it will find the correct Category to instantiate from + */ + public VerificationConfiguration(Concept concept) { + super(concept); + } + + /** + * Constructor of Concept Class that can be initialized manually by a given Category Assignment + * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean + */ + public VerificationConfiguration(CategoryAssignment categoryAssignment) { + super(categoryAssignment); + } +} diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementTrace.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationType.java similarity index 87% rename from de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementTrace.java rename to de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationType.java index 8643bfa142..67bd314428 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/RequirementTrace.java +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/model/VerificationType.java @@ -27,12 +27,12 @@ * * */ -public class RequirementTrace extends ARequirementTrace { +public class VerificationType extends AVerificationType { /** * Constructor of Concept Class */ - public RequirementTrace() { + public VerificationType() { super(); } @@ -41,7 +41,7 @@ public RequirementTrace() { * a CategoryAssignment in the background from the given concept * @param concept the concept where it will find the correct Category to instantiate from */ - public RequirementTrace(Concept concept) { + public VerificationType(Concept concept) { super(concept); } @@ -49,7 +49,7 @@ public RequirementTrace(Concept concept) { * Constructor of Concept Class that can be initialized manually by a given Category Assignment * @param categoryAssignment The category Assignment to be used for background initialization of the Category bean */ - public RequirementTrace(CategoryAssignment categoryAssignment) { + public VerificationType(CategoryAssignment categoryAssignment) { super(categoryAssignment); } } diff --git a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/validator/RequirementsValidator.java b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/validator/RequirementsValidator.java index f68aaebbb1..be7b6f70f8 100644 --- a/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/validator/RequirementsValidator.java +++ b/de.dlr.sc.virsat.model.extension.requirements/src/de/dlr/sc/virsat/model/extension/requirements/validator/RequirementsValidator.java @@ -9,7 +9,6 @@ *******************************************************************************/ package de.dlr.sc.virsat.model.extension.requirements.validator; -import de.dlr.sc.virsat.model.dvlm.structural.StructuralElementInstance; import de.dlr.sc.virsat.model.dvlm.validator.IStructuralElementInstanceValidator; @@ -27,8 +26,4 @@ */ public class RequirementsValidator extends ARequirementsValidator implements IStructuralElementInstanceValidator { - @Override - public boolean validate(StructuralElementInstance sei) { - return super.validate(sei); - } } diff --git a/de.dlr.sc.virsat.model.extension.statemachines.feature/feature.xml b/de.dlr.sc.virsat.model.extension.statemachines.feature/feature.xml index af2708d0e1..a091b0a696 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.statemachines.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.statemachines.feature/pom.xml b/de.dlr.sc.virsat.model.extension.statemachines.feature/pom.xml index 4b1af8ba81..af3019d713 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.statemachines.feature/pom.xml @@ -13,7 +13,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml diff --git a/de.dlr.sc.virsat.model.extension.statemachines.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.statemachines.test/META-INF/MANIFEST.MF index a644310f9b..157ff1fb14 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.statemachines.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension State Machines Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.statemachines.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.statemachines;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.statemachines.test/pom.xml b/de.dlr.sc.virsat.model.extension.statemachines.test/pom.xml index a427eae4ad..5967f008f9 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.statemachines.test/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.statemachines.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.statemachines.ui/META-INF/MANIFEST.MF index 4c7f3a26ea..ef807ffaa0 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.statemachines.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension State Machines UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.statemachines.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.statemachines, org.eclipse.core.runtime, org.eclipse.core.expressions, diff --git a/de.dlr.sc.virsat.model.extension.statemachines.ui/pom.xml b/de.dlr.sc.virsat.model.extension.statemachines.ui/pom.xml index aa7da0a65a..0a2edcf52d 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.statemachines.ui/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.statemachines/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.statemachines/META-INF/MANIFEST.MF index 8c33ede7f3..44feaa2aae 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.statemachines/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension State Machines Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.statemachines;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, de.dlr.sc.virsat.build, diff --git a/de.dlr.sc.virsat.model.extension.statemachines/pom.xml b/de.dlr.sc.virsat.model.extension.statemachines/pom.xml index 973d9753d1..016a3bef39 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/pom.xml +++ b/de.dlr.sc.virsat.model.extension.statemachines/pom.xml @@ -12,7 +12,7 @@ de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAConstraint.java b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAConstraint.java index bcbde7d620..7b7b41fa3c 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAConstraint.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAConstraint.java @@ -12,17 +12,23 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; -import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import org.eclipse.emf.edit.domain.EditingDomain; -import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +43,8 @@ * General constraint in statemachines * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AAConstraint extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.statemachines.AConstraint"; @@ -83,6 +91,8 @@ private void safeAccessStateConstraining() { stateConstraining.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public State getStateConstraining() { safeAccessStateConstraining(); return stateConstraining.getValue(); @@ -113,6 +123,8 @@ private void safeAccessStateInfluenced() { stateInfluenced.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public State getStateInfluenced() { safeAccessStateInfluenced(); return stateInfluenced.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAllowsConstraint.java b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAllowsConstraint.java index dd55213e1e..03325cdac9 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAllowsConstraint.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AAllowsConstraint.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * A state explicitly allows another state * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AAllowsConstraint extends AConstraint implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.statemachines.AllowsConstraint"; diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AForbidsConstraint.java b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AForbidsConstraint.java index 5fc53ba006..4288c9e146 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AForbidsConstraint.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AForbidsConstraint.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * A state forbids another state * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AForbidsConstraint extends AConstraint implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.statemachines.ForbidsConstraint"; diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AState.java b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AState.java index 739c5c8d30..13811476a7 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AState.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AState.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * State of the component at a given time * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AState extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.statemachines.State"; diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AStateMachine.java b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AStateMachine.java index abd6f82f9e..838c420b19 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AStateMachine.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/AStateMachine.java @@ -12,24 +12,30 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -44,6 +50,8 @@ * A state machine with states and transitions * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AStateMachine extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.statemachines.StateMachine"; @@ -120,6 +128,7 @@ public double getTypeEnum() { return type.getEnumValue(); } + @XmlElement public BeanPropertyEnum getTypeBean() { safeAccessType(); return type; @@ -135,6 +144,8 @@ private void safeAccessInitialState() { initialState.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public State getInitialState() { safeAccessInitialState(); return initialState.getValue(); @@ -179,6 +190,7 @@ private void safeAccessStatesBean() { } } + @XmlElement public IBeanList> getStatesBean() { safeAccessStatesBean(); return statesBean; @@ -208,6 +220,7 @@ private void safeAccessTransitionsBean() { } } + @XmlElement public IBeanList> getTransitionsBean() { safeAccessTransitionsBean(); return transitionsBean; @@ -237,6 +250,7 @@ private void safeAccessConstraintsBean() { } } + @XmlElement public IBeanList> getConstraintsBean() { safeAccessConstraintsBean(); return constraintsBean; diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/ATransition.java b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/ATransition.java index 9df2ec7d20..9805e33077 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/ATransition.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src-gen/de/dlr/sc/virsat/model/extension/statemachines/model/ATransition.java @@ -12,17 +12,23 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; -import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import org.eclipse.emf.edit.domain.EditingDomain; -import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; -import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +43,8 @@ * Transitions among states * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATransition extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.statemachines.Transition"; @@ -83,6 +91,8 @@ private void safeAccessStateFrom() { stateFrom.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public State getStateFrom() { safeAccessStateFrom(); return stateFrom.getValue(); @@ -113,6 +123,8 @@ private void safeAccessStateTo() { stateTo.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public State getStateTo() { safeAccessStateTo(); return stateTo.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/exporter/StateMachineExporter.java b/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/exporter/StateMachineExporter.java index 12ce0a5f77..684e6fcfbf 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/exporter/StateMachineExporter.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/exporter/StateMachineExporter.java @@ -39,14 +39,19 @@ */ public class StateMachineExporter implements IExport { - public StateMachineExporter(LocalDateTime localDateTime) { - this.localDateTime = localDateTime; - } + private static final String DEFAULT_TEMPLATE_PATH = "/resources/StateMachineExportTemplate.xlsx"; protected LocalDateTime localDateTime; - private static final String DEFAULT_TEMPLATE_PATH = "/resources/StateMachineExportTemplate.xlsx"; protected ExcelExportHelper helper = new ExcelExportHelper(); private CategoryAssignment exportCa; + + public StateMachineExporter() { + this(LocalDateTime.now()); + } + + public StateMachineExporter(LocalDateTime localDateTime) { + this.localDateTime = localDateTime; + } @Override public void export(EObject eObject, String path, boolean useDefaultTemplate, String templatePath) { @@ -112,13 +117,13 @@ private void createDataSheetStates() { } StateMachine stateMaschine = new StateMachine(exportCa); IBeanList states = stateMaschine.getStates(); - helper.instantiateCells(sheet, states.size() + AExcelStatIO.COMMON_ROW_START_TABLE, AExcelStatIO.INTERFACEEND_COLUMN_INTERFACEEND_TYPE + 1); + helper.instantiateCells(sheet, states.size() + AExcelStatIO.COMMON_ROW_START_TABLE, AExcelStatIO.TRANSITION_COLUMN_TRANSITION_FROM + 1); // for each interface end, fill out a row int i = AExcelStatIO.COMMON_ROW_START_TABLE; for (State state : states) { Row row = sheet.getRow(i); row.getCell(AExcelStatIO.COMMON_COLUMN_UUID).setCellValue(helper.getCreationHelper().createRichTextString(state.getTypeInstance().getUuid().toString())); - row.getCell(AExcelStatIO.INTERFACEEND_COLUMN_INTERFACEEND_NAME).setCellValue(helper.getCreationHelper().createRichTextString(state.getName())); + row.getCell(AExcelStatIO.TRANSITION_COLUMN_TRANSITION_NAME).setCellValue(helper.getCreationHelper().createRichTextString(state.getName())); i++; } } @@ -134,7 +139,7 @@ private void createDataSheetTransitions() { StateMachine stateMaschine = new StateMachine(exportCa); IBeanList transitions = stateMaschine.getTransitions(); - helper.instantiateCells(sheet, transitions.size() + AExcelStatIO.COMMON_ROW_START_TABLE, AExcelStatIO.INTERFACE_COLUMN_INTERFACE_TO + 1); + helper.instantiateCells(sheet, transitions.size() + AExcelStatIO.COMMON_ROW_START_TABLE, AExcelStatIO.TRANSITION_COLUMN_TRANSITION_TO + 1); int i = AExcelStatIO.COMMON_ROW_START_TABLE; for (Transition transition : transitions) { diff --git a/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/importer/ImportValidator.java b/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/importer/ImportValidator.java index 19156656f2..253d06484a 100644 --- a/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/importer/ImportValidator.java +++ b/de.dlr.sc.virsat.model.extension.statemachines/src/de/dlr/sc/virsat/model/extension/statemachines/excel/importer/ImportValidator.java @@ -168,14 +168,14 @@ public void validateHeaders() { final int sheetIndex = wb.getSheetIndex(AExcelStatIO.TEMPLATE_SHEETNAME_HEADER); // Control if we are importing the correct Structural element by comparing UUIDs - String tempUUID = Objects.toString(sheet.getRow(AExcelStatIO.HEADER_ROW_STRUCTURALELEMENTUUID).getCell(1), ""); + String tempUUID = Objects.toString(sheet.getRow(AExcelStatIO.HEADER_ROW_STRUCTURALELEMENT_UUID).getCell(1), ""); if (!(importSei.getUuid().toString().equals(tempUUID))) { - faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_UUIDS_DO_NOT_MATCH, sheetIndex, AExcelStatIO.HEADER_ROW_STRUCTURALELEMENTUUID)); + faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_UUIDS_DO_NOT_MATCH, sheetIndex, AExcelStatIO.HEADER_ROW_STRUCTURALELEMENT_UUID)); } // Control if we are importing the correct Structural element by comparing NAMEs - String tempName = Objects.toString(sheet.getRow(AExcelStatIO.HEADER_ROW_STRUCTURALELEMENTNAME).getCell(1), ""); + String tempName = Objects.toString(sheet.getRow(AExcelStatIO.HEADER_ROW_STRUCTURALELEMENT_NAME).getCell(1), ""); if (!(importSei.getName().equals(tempName))) { - faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_NAMES_DO_NOT_MATCH, sheetIndex, AExcelStatIO.HEADER_ROW_STRUCTURALELEMENTNAME)); + faultList.add(new Fault(FaultType.STRUCTURAL_ELEMENT_NAMES_DO_NOT_MATCH, sheetIndex, AExcelStatIO.HEADER_ROW_STRUCTURALELEMENT_NAME)); } } } diff --git a/de.dlr.sc.virsat.model.extension.tests.edit.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.tests.edit.test/META-INF/MANIFEST.MF index ddb8d234ac..5b20156177 100644 --- a/de.dlr.sc.virsat.model.extension.tests.edit.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.tests.edit.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Test Concept Edit Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.tests.edit.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) Fragment-Host: de.dlr.sc.virsat.model.extension.tests.edit diff --git a/de.dlr.sc.virsat.model.extension.tests.edit.test/pom.xml b/de.dlr.sc.virsat.model.extension.tests.edit.test/pom.xml index ce52fe16fd..88d1ce56c8 100644 --- a/de.dlr.sc.virsat.model.extension.tests.edit.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.tests.edit.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.tests.edit/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.tests.edit/META-INF/MANIFEST.MF index 903c423fb6..cbdaad31c3 100644 --- a/de.dlr.sc.virsat.model.extension.tests.edit/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.tests.edit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.tests.edit;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Activator: de.dlr.sc.virsat.model.extension.tests.tests.provider.ConceptEditPlugin$Implementation Bundle-Vendor: %providerName diff --git a/de.dlr.sc.virsat.model.extension.tests.edit/plugin.properties b/de.dlr.sc.virsat.model.extension.tests.edit/plugin.properties index fa1cf8696c..c0df313f5e 100644 --- a/de.dlr.sc.virsat.model.extension.tests.edit/plugin.properties +++ b/de.dlr.sc.virsat.model.extension.tests.edit/plugin.properties @@ -1,7 +1,7 @@ # -pluginName = Concept Edit Support -providerName = www.example.org +pluginName = VirSat Core Model Extension Tests Edit Support +providerName = DLR (German Aerospace Center) _UI_CreateChild_text = {0} _UI_CreateChild_text2 = {1} {0} diff --git a/de.dlr.sc.virsat.model.extension.tests.edit/pom.xml b/de.dlr.sc.virsat.model.extension.tests.edit/pom.xml index f989f89bef..0f707c94c9 100644 --- a/de.dlr.sc.virsat.model.extension.tests.edit/pom.xml +++ b/de.dlr.sc.virsat.model.extension.tests.edit/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.tests.feature/feature.xml b/de.dlr.sc.virsat.model.extension.tests.feature/feature.xml index a9b0bca102..3416327d15 100644 --- a/de.dlr.sc.virsat.model.extension.tests.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.tests.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.tests.feature/pom.xml b/de.dlr.sc.virsat.model.extension.tests.feature/pom.xml index 71666fa5cb..b01dea66a5 100644 --- a/de.dlr.sc.virsat.model.extension.tests.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.tests.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.extension.tests.feature diff --git a/de.dlr.sc.virsat.model.extension.tests.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.tests.test/META-INF/MANIFEST.MF index 5eb9e5f3b2..02a23e2d19 100644 --- a/de.dlr.sc.virsat.model.extension.tests.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.tests.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Test Concept Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.tests.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) Fragment-Host: de.dlr.sc.virsat.model.extension.tests;bundle-version="0.0.1" diff --git a/de.dlr.sc.virsat.model.extension.tests.test/build.properties b/de.dlr.sc.virsat.model.extension.tests.test/build.properties index 978dd33813..a40f8e812c 100644 --- a/de.dlr.sc.virsat.model.extension.tests.test/build.properties +++ b/de.dlr.sc.virsat.model.extension.tests.test/build.properties @@ -1,7 +1,8 @@ output.. = target/classes/ bin.includes = .,\ META-INF/,\ - about.html + about.html,\ + resources/ jars.compile.order = . source.. = src/,\ src-gen/ diff --git a/de.dlr.sc.virsat.model.extension.tests.test/pom.xml b/de.dlr.sc.virsat.model.extension.tests.test/pom.xml index 2f8d9d6990..682aa87256 100644 --- a/de.dlr.sc.virsat.model.extension.tests.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.tests.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryAllProperty_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryAllProperty_Marshaling.json new file mode 100644 index 0000000000..9f401bd387 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryAllProperty_Marshaling.json @@ -0,0 +1,32 @@ +{ + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0", + "name" : "TestCategoryAllProperty", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d0", + "value" : true + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49390", + "unit" : "", + "value" : "HIGH" + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3820", + "unit" : "", + "value" : 0.0 + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd80", + "unit" : "", + "value" : 1 + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb0", + "value" : "/resources/file[1].xls" + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa0", + "value" : "this is a test" + } +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryAllProperty_Marshaling_Defaults.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryAllProperty_Marshaling_Defaults.json new file mode 100644 index 0000000000..f02ade0a90 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryAllProperty_Marshaling_Defaults.json @@ -0,0 +1,32 @@ +{ + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0", + "name" : "TestCategoryAllProperty", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d0", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49390", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3820", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd80", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb0", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa0", + "value" : null + } +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryBeanA_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryBeanA_Marshaling.json new file mode 100644 index 0000000000..f559614bfd --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryBeanA_Marshaling.json @@ -0,0 +1,5 @@ +{ + "type" :"testCategoryBeanA", + "uuid" :"f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" :"TestCategoryBeanA" +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling.json new file mode 100644 index 0000000000..8ccade0167 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling.json @@ -0,0 +1,177 @@ +{ + "type" : "testCategoryCompositionArray", + "uuid" : "f5d016ac-65fa-4b9d-ae94-582d4f73138a", + "name" : "TestCategoryCompositionArray", + "testCompositionArrayDynamicBean" : [ { + "uuid" : "25ed5be7-de0d-4672-95be-8ccce3a7e2e2", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f4", + "name" : "TestCategoryAllProperty", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d4", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49394", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3824", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd84", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb4", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa4", + "value" : null + } + } + } ], + "testCompositionArrayStaticBean" : [ { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b0", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d0", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49390", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3820", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd80", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb0", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa0", + "value" : "testString" + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b1", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f1", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d1", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49391", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3821", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd81", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb1", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa1", + "value" : null + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b2", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d2", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49392", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3822", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd82", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb2", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa2", + "value" : null + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b3", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f3", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d3", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49393", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3823", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd83", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb3", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa3", + "value" : null + } + } + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling_ChangeElement.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling_ChangeElement.json new file mode 100644 index 0000000000..dbaf9da4be --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling_ChangeElement.json @@ -0,0 +1,143 @@ +{ + "type" : "testCategoryCompositionArray", + "uuid" : "f5d016ac-65fa-4b9d-ae94-582d4f73138a", + "name" : "TestCategoryCompositionArray", + "testCompositionArrayDynamicBean" : [ ], + "testCompositionArrayStaticBean" : [ { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b0", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f9", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d9", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49399", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3829", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd89", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb9", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa9", + "value" : "testString" + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b1", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f1", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d1", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49391", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3821", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd81", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb1", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa1", + "value" : null + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b2", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d2", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49392", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3822", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd82", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb2", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa2", + "value" : null + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b3", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f3", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d3", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49393", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3823", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd83", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb3", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa3", + "value" : null + } + } + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling_NullComposition.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling_NullComposition.json new file mode 100644 index 0000000000..c9c7df84bc --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryCompositionArray_Marshaling_NullComposition.json @@ -0,0 +1,112 @@ +{ + "type" : "testCategoryCompositionArray", + "uuid" : "f5d016ac-65fa-4b9d-ae94-582d4f73138a", + "name" : "TestCategoryCompositionArray", + "testCompositionArrayDynamicBean" : [ ], + "testCompositionArrayStaticBean" : [ { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b0", + "value" : null + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b1", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f1", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d1", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49391", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3821", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd81", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb1", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa1", + "value" : null + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b2", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d2", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49392", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3822", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd82", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb2", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa2", + "value" : null + } + } + }, { + "uuid" : "45e18c9d-ef85-4ab8-ba2a-c5916697a0b3", + "value" : { + "type" : "testCategoryAllProperty", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f3", + "name" : "testCompositionArrayStatic", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d3", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49393", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3823", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd83", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb3", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa3", + "value" : null + } + } + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryComposition_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryComposition_Marshaling.json new file mode 100644 index 0000000000..d0cc2c844b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryComposition_Marshaling.json @@ -0,0 +1,36 @@ +{ + "type" : "testCategoryComposition", + "uuid" : "028a6e1b-e7c4-4937-886b-d65452426bfd", + "name" : "TestCategoryComposition", + "testSubCategory" : { + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0", + "name" : "testSubCategory", + "testBoolBean" : { + "uuid" : "b9bfb08f-2778-4fe9-a774-3d8b0ad638d0", + "value" : false + }, + "testEnumBean" : { + "uuid" : "ed62d73c-dbba-409c-b73c-f0d3d9f49390", + "unit" : "", + "value" : null + }, + "testFloatBean" : { + "uuid" : "2870876e-4d6c-4128-801d-54fa109f3820", + "unit" : "", + "value" : null + }, + "testIntBean" : { + "uuid" : "0f37aff6-ccc0-436f-a592-bd466f74bd80", + "unit" : "", + "value" : null + }, + "testResourceBean" : { + "uuid" : "fa822159-51a5-4bf2-99cf-e565b67e0eb0", + "value" : null + }, + "testStringBean" : { + "uuid" : "26edbae8-9f05-4ef5-8673-91e1af668aa0", + "value" : "testString" + } + } +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryComposition_Marshaling_NullComposition.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryComposition_Marshaling_NullComposition.json new file mode 100644 index 0000000000..27e5343558 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryComposition_Marshaling_NullComposition.json @@ -0,0 +1,6 @@ +{ + "type" : "testCategoryComposition", + "uuid" : "028a6e1b-e7c4-4937-886b-d65452426bfd", + "name" : "TestCategoryComposition", + "testSubCategory" : null +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryIntrinsicArray_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryIntrinsicArray_Marshaling.json new file mode 100644 index 0000000000..70abbd0769 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryIntrinsicArray_Marshaling.json @@ -0,0 +1,22 @@ +{ + "type" : "testCategoryIntrinsicArray", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "TestCategoryIntrinsicArray", + "testStringArrayDynamicBean" : [ { + "uuid" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50", + "value" : "testString" + } ], + "testStringArrayStaticBean" : [ { + "uuid" : "4efe0002-f081-49c0-9917-6f4a6e7dd9ce", + "value" : "testString" + }, { + "uuid" : "6ad3d35a-a0b4-48e8-9bfd-e6edf438eee5", + "value" : null + }, { + "uuid" : "8fd96e3b-5bf3-41e1-a02a-64f8bff99107", + "value" : null + }, { + "uuid" : "c38d7185-fcc3-480c-bfb4-28e6fcc09d34", + "value" : null + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling.json new file mode 100644 index 0000000000..401a145a0c --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling.json @@ -0,0 +1,39 @@ +{ + "type" : "testCategoryReferenceArray", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "TestCategoryReferenceArray", + "testCategoryReferenceArrayDynamicBean" : [ { + "uuid" : "0544cfe4-ec11-4585-8f1b-e875e26ae33c", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + } ], + "testCategoryReferenceArrayStaticBean" : [ { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a0", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a1", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a2", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a3", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + } ], + "testPropertyReferenceArrayDynamicBean" : [ { + "uuid" : "f8932f09-71b7-40b6-bcbd-5d71c2b8d6d7", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + } ], + "testPropertyReferenceArrayStaticBean" : [ { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee30", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee31", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee32", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee33", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling_ChangeReference.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling_ChangeReference.json new file mode 100644 index 0000000000..02050d246a --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling_ChangeReference.json @@ -0,0 +1,33 @@ +{ + "type" : "testCategoryReferenceArray", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "TestCategoryReferenceArray", + "testCategoryReferenceArrayDynamicBean" : [ ], + "testCategoryReferenceArrayStaticBean" : [ { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a0", + "value" : "134d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a1", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a2", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a3", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + } ], + "testPropertyReferenceArrayDynamicBean" : [ ], + "testPropertyReferenceArrayStaticBean" : [ { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee30", + "value" : "1256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee31", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee32", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee33", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling_NullReference.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling_NullReference.json new file mode 100644 index 0000000000..e9f5c4b41f --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReferenceArray_Marshaling_NullReference.json @@ -0,0 +1,33 @@ +{ + "type" : "testCategoryReferenceArray", + "uuid" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2", + "name" : "TestCategoryReferenceArray", + "testCategoryReferenceArrayDynamicBean" : [ ], + "testCategoryReferenceArrayStaticBean" : [ { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a0", + "value" : null + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a1", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a2", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + }, { + "uuid" : "8872b433-968c-4f48-b9a3-d734c6e239a3", + "value" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0" + } ], + "testPropertyReferenceArrayDynamicBean" : [ ], + "testPropertyReferenceArrayStaticBean" : [ { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee30", + "value" : null + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee31", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee32", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + }, { + "uuid" : "49177554-f1e4-4529-bf1b-3036abb1ee33", + "value" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" + } ] +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling.json new file mode 100644 index 0000000000..9f18a7456b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling.json @@ -0,0 +1,7 @@ +{ + "type" : "testCategoryReference", + "uuid" : "0370d14d-e6a1-4660-83f1-5bb98fa840ac", + "name" : "TestCategoryReference", + "testRefCategory" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0", + "testRefProperty" : "7256e7a2-9a1f-443c-85f8-7b766eac3f50" +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling_ChangeReference.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling_ChangeReference.json new file mode 100644 index 0000000000..74a0bf143e --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling_ChangeReference.json @@ -0,0 +1,7 @@ +{ + "type" : "testCategoryReference", + "uuid" : "0370d14d-e6a1-4660-83f1-5bb98fa840ac", + "name" : "TestCategoryReference", + "testRefCategory" : "f34d30b0-80f5-4c96-864f-29ab4d3ae9f0", + "testRefProperty" : "1256e7a2-9a1f-443c-85f8-7b766eac3f50" +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling_NullReference.json b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling_NullReference.json new file mode 100644 index 0000000000..b9246cc5cb --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/resources/json/TestCategoryReference_Marshaling_NullReference.json @@ -0,0 +1,7 @@ +{ + "type" : "testCategoryReference", + "uuid" : "0370d14d-e6a1-4660-83f1-5bb98fa840ac", + "name" : "TestCategoryReference", + "testRefCategory" : null, + "testRefProperty" : null +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/concept/types/factory/BeanTypeInstanceFactoryTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/concept/types/factory/BeanTypeInstanceFactoryTest.java new file mode 100644 index 0000000000..dc50b39716 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/concept/types/factory/BeanTypeInstanceFactoryTest.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.concept.types.factory; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.eclipse.core.runtime.CoreException; +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.concept.types.IBeanObject; +import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.concept.types.property.IBeanProperty; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import de.dlr.sc.virsat.model.dvlm.categories.CategoriesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.dvlm.categories.propertydefinitions.PropertydefinitionsFactory; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryBeanA; + +public class BeanTypeInstanceFactoryTest extends AConceptTestCase { + private BeanTypeInstanceFactory tiBeanFactory; + private Concept concept; + + @Before + public void setup() { + tiBeanFactory = new BeanTypeInstanceFactory(); + // Load the concept to create the test object + concept = loadConceptFromPlugin(); + } + + @Test + public void testGetInstanceForProperty() throws CoreException { + ATypeInstance property = PropertyinstancesFactory.eINSTANCE.createValuePropertyInstance(); + property.setType(PropertydefinitionsFactory.eINSTANCE.createStringProperty()); + + IBeanObject propBean = tiBeanFactory.getInstanceFor(property); + assertTrue("Created bean is of correct type", propBean instanceof IBeanProperty); + assertTrue("Created bean is of correct type", propBean instanceof BeanPropertyString); + } + + @Test + public void testGetInstanceForCategoryAssignment() throws CoreException { + Category category = ActiveConceptHelper.getCategory(concept, "TestCategoryBeanA"); + CategoryAssignment ca = new CategoryInstantiator().generateInstance(category, "TestCategoryBeanA"); + + IBeanObject caBean = tiBeanFactory.getInstanceFor(ca); + assertTrue("Created bean is of correct type", caBean instanceof IBeanCategoryAssignment); + assertTrue("Created bean is of correct type", caBean instanceof TestCategoryBeanA); + assertEquals("Bean has a type instance set", ca, caBean.getTypeInstance()); + assertEquals("Type instance of bean is set correctly", "TestCategoryBeanA", caBean.getTypeInstance().getType().getName()); + } + + @Test(expected = CoreException.class) + public void testGetInstanceForUnregisteredCategoryAssignment() throws CoreException { + Category category = CategoriesFactory.eINSTANCE.createCategory(); + category.setName("Unregistered_Category"); + CategoryAssignment ca = new CategoryInstantiator().generateInstance(category, "TestUnregisteredCategoryAssignment"); + + tiBeanFactory.getInstanceFor(ca); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/TestCategoryIntrinsicArrayStaticTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/TestCategoryIntrinsicArrayStaticTest.java index 0853428009..61584454fc 100644 --- a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/TestCategoryIntrinsicArrayStaticTest.java +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/TestCategoryIntrinsicArrayStaticTest.java @@ -11,6 +11,8 @@ import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertThrows; import java.util.ArrayList; import java.util.List; @@ -30,8 +32,6 @@ /** * test case for the array capabilities on intrinsic properties in the beans model - * @author fisc_ph - * */ public class TestCategoryIntrinsicArrayStaticTest extends AConceptTestCase { @@ -70,7 +70,7 @@ public void testAddAllIntCollectionOfQextendsBeansType() { BeanPropertyString property2 = createNewStringProperty(); BeanPropertyString property3 = createNewStringProperty(); - assertEquals("List has one items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); + assertEquals("List has four items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); List addBeans = new ArrayList<>(); addBeans.add(property1); @@ -80,20 +80,30 @@ public void testAddAllIntCollectionOfQextendsBeansType() { arrayStatic.addAll(addBeans); } - @Test(expected = UnsupportedOperationException.class) + @Test public void testAddBeanType() { BeanPropertyString property1 = createNewStringProperty(); - assertEquals("List has one items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); - - arrayStatic.add(property1); + assertEquals("List has four items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); + + assertThrows("Can't add an element with a new uuid", UnsupportedOperationException.class, () -> { + arrayStatic.add(property1); + }); + + property1.getATypeInstance().setUuid(arrayStatic.get(0).getATypeInstance().getUuid()); + assertNotEquals("Elements are not the same", property1.getATypeInstance(), arrayStatic.get(0).getATypeInstance()); + arrayStatic.add(property1); + assertEquals("Added the element", property1, arrayStatic.get(0)); + + arrayStatic.add(property1); + assertEquals("Adding the same element again is idempotent for static lists", property1, arrayStatic.get(0)); } @Test public void testAddBeanTypeCommand() { BeanPropertyString property1 = createNewStringProperty(); - assertEquals("List has one items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); + assertEquals("List has four items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); Command command = arrayStatic.add(editingDomain, property1); assertEquals("Command cannot be executed", UnexecutableCommand.INSTANCE, command); @@ -103,7 +113,7 @@ public void testAddBeanTypeCommand() { public void testAddIntBeanType() { BeanPropertyString property1 = createNewStringProperty(); - assertEquals("List has one items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); + assertEquals("List has four items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); arrayStatic.add(1, property1); } @@ -118,7 +128,7 @@ public void testRemoveAll() { BeanPropertyString property1 = createNewStringProperty(); BeanPropertyString property3 = createNewStringProperty(); - assertEquals("List has one items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); + assertEquals("List has four items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); List removeBeans = new ArrayList<>(); removeBeans.add(property1); @@ -143,7 +153,7 @@ public void testRemoveObject() { public void testRemoveObjectCommand() { BeanPropertyString property1 = createNewStringProperty(); - assertEquals("List has one items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); + assertEquals("List has four items", LIST_WITH_STATIC_SIZE, arrayStatic.size()); Command command = arrayStatic.remove(editingDomain, property1); assertEquals("Command cannot be executed", UnexecutableCommand.INSTANCE, command); @@ -161,10 +171,16 @@ public void testRetainAll() { arrayStatic.retainAll(retainBeans); } - @Test(expected = UnsupportedOperationException.class) + @Test public void testSetIntBeanType() { - BeanPropertyString property3 = createNewStringProperty(); + BeanPropertyString property1 = createNewStringProperty(); - arrayStatic.set(1, property3); + property1.getATypeInstance().setUuid(arrayStatic.get(0).getATypeInstance().getUuid()); + assertThrows("Can't set an element with another uuid", UnsupportedOperationException.class, () -> { + arrayStatic.set(1, property1); + }); + + arrayStatic.set(0, property1); + assertEquals("Property set correctly", property1, arrayStatic.get(0)); } } diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/JsonTestHelper.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/JsonTestHelper.java new file mode 100644 index 0000000000..650bb3b495 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/JsonTestHelper.java @@ -0,0 +1,154 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static de.dlr.sc.virsat.model.extension.tests.test.TestActivator.assertEqualsNoWs; + +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Collection; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceImpl; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.concept.types.IBeanObject; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.dvlm.DVLMFactory; +import de.dlr.sc.virsat.model.dvlm.Repository; +import de.dlr.sc.virsat.model.dvlm.categories.ATypeInstance; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.qudv.SystemOfUnits; +import de.dlr.sc.virsat.model.dvlm.qudv.util.QudvUnitHelper; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.dvlm.units.UnitManagement; +import de.dlr.sc.virsat.model.dvlm.units.UnitsFactory; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +import de.dlr.sc.virsat.model.extension.tests.test.TestActivator; + +/** + * Class containing static helper functions + * to remove redundancy in JSON test cases + */ +public class JsonTestHelper { + + public static final String TEST_STRING = "testString"; + + private JsonTestHelper() { } + + /** + * Set all UUIDs of a tcAllProperty + * @param tcAllProperty to be set + */ + public static void setTestCategoryAllPropertyUuids(TestCategoryAllProperty tcAllProperty) { + setTestCategoryAllPropertyUuids(tcAllProperty, 0); + } + + /** + * Set all UUIDs of a tcAllProperty + * The last character can be edited + * @param tcAllProperty to be set + * @param lastChar of the UUID + */ + public static void setTestCategoryAllPropertyUuids(TestCategoryAllProperty tcAllProperty, int lastChar) { + tcAllProperty.getTypeInstance().setUuid(new VirSatUuid("f34d30b0-80f5-4c96-864f-29ab4d3ae9f" + lastChar)); + tcAllProperty.getTestBoolBean().getATypeInstance().setUuid(new VirSatUuid("b9bfb08f-2778-4fe9-a774-3d8b0ad638d" + lastChar)); + tcAllProperty.getTestEnumBean().getATypeInstance().setUuid(new VirSatUuid("ed62d73c-dbba-409c-b73c-f0d3d9f4939" + lastChar)); + tcAllProperty.getTestFloatBean().getATypeInstance().setUuid(new VirSatUuid("2870876e-4d6c-4128-801d-54fa109f382" + lastChar)); + tcAllProperty.getTestIntBean().getATypeInstance().setUuid(new VirSatUuid("0f37aff6-ccc0-436f-a592-bd466f74bd8" + lastChar)); + tcAllProperty.getTestResourceBean().getATypeInstance().setUuid(new VirSatUuid("fa822159-51a5-4bf2-99cf-e565b67e0eb" + lastChar)); + tcAllProperty.getTestStringBean().getATypeInstance().setUuid(new VirSatUuid("26edbae8-9f05-4ef5-8673-91e1af668aa" + lastChar)); + } + + /** + * Create a Repository with a UnitManagement from the Concept + * @param concept + * @return Repository + */ + public static Repository createRepositoryWithUnitManagement(Concept concept) { + Repository repo = DVLMFactory.eINSTANCE.createRepository(); + UnitManagement unitManagement = UnitsFactory.eINSTANCE.createUnitManagement(); + + SystemOfUnits sou = QudvUnitHelper.getInstance().initializeSystemOfUnits("SystemOfUnits", "SoU", "the system of Units", "http://the.system.of.units.de"); + + unitManagement.setSystemOfUnit(sou); + repo.setUnitManagement(unitManagement); + repo.getActiveConcepts().add(concept); + + return repo; + } + + public static BeanPropertyString createTestStringBean(Concept concept) { + BeanPropertyString bpString = new TestCategoryAllProperty(concept).getTestStringBean(); + bpString.getATypeInstance().setUuid(new VirSatUuid("7256e7a2-9a1f-443c-85f8-7b766eac3f50")); + return bpString; + } + + // CHECKSTYLE:OFF + public static void setStaticIBeanListUuids(IBeanList> list) { + list.get(0).getATypeInstance().setUuid(new VirSatUuid("4efe0002-f081-49c0-9917-6f4a6e7dd9ce")); + list.get(1).getATypeInstance().setUuid(new VirSatUuid("6ad3d35a-a0b4-48e8-9bfd-e6edf438eee5")); + list.get(2).getATypeInstance().setUuid(new VirSatUuid("8fd96e3b-5bf3-41e1-a02a-64f8bff99107")); + list.get(3).getATypeInstance().setUuid(new VirSatUuid("c38d7185-fcc3-480c-bfb4-28e6fcc09d34")); + list.getArrayInstance().setUuid(new VirSatUuid("98218bbf-a5ee-432d-b01c-da48f4f9495b")); + } + // CHECKSTYLE:ON + + /** + * Marshalls the test object and asserts that the result equals the test resource + * @param jaxbUtility the JAXBUtility with the needed classes registered + * @param resource the test resource + * @param testObject the object to assert with the resource + * @throws JAXBException + * @throws IOException + */ + public static void assertMarshall(JAXBUtility jaxbUtility, String resource, IBeanObject testObject) throws JAXBException, IOException { + Marshaller jsonMarshaller = jaxbUtility.getJsonMarshaller(); + + StringWriter sw = new StringWriter(); + jsonMarshaller.marshal(testObject, sw); + + String expectedJson = TestActivator.getResourceContentAsString(resource); + assertEqualsNoWs("Json is as expected", expectedJson, sw.toString()); + } + + /** + * Embeds the modelObjects into an ResourceSet to then create the Unmarshaller with the JAXBUtility + * @param jaxbUtility the JAXBUtility with the needed classes registered + * @param modelObjects the objects to be embedded into the ResourceSet + * @return the Unmarshaller + * @throws JAXBException + * @throws IOException + */ + public static Unmarshaller getUnmarshaller(JAXBUtility jaxbUtility, Collection modelObjects) throws JAXBException, IOException { + // Quick mock setup to embed the model into a resource set + ResourceSet resourceSet = new ResourceSetImpl(); + Resource resourceImpl = new ResourceImpl(); + resourceSet.getResources().add(resourceImpl); + resourceImpl.getContents().addAll(modelObjects); + + return jaxbUtility.getJsonUnmarshaller(resourceSet); + } + + public static StreamSource getResourceAsStreamSource(String resource) throws IOException { + String inputJson = TestActivator.getResourceContentAsString(resource); + return new StreamSource(new StringReader(inputJson)); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryAllPropertyTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryAllPropertyTest.java new file mode 100644 index 0000000000..be74cde87d --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryAllPropertyTest.java @@ -0,0 +1,155 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.eclipse.emf.common.util.URI; +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +public class TestCategoryAllPropertyTest extends AConceptTestCase { + + private TestCategoryAllProperty tcAllProperty; + private JAXBUtility jaxbUtility; + private Concept concept; + + private static final String RESOURCE_WITH_DEFAULTS = "/resources/json/TestCategoryAllProperty_Marshaling_Defaults.json"; + private static final String RESOURCE_WITH_VALUES = "/resources/json/TestCategoryAllProperty_Marshaling.json"; + + private static final boolean TEST_BOOL = true; + private static final int TEST_INT = 1; + private static final double TEST_FLOAT = 0.0; + private static final String TEST_STRING = "this is a test"; + private static final String TEST_ENUM = "HIGH"; + private static final String TEST_RESOURCE = "resources/file[1].xls"; + private static final String TEST_RESOURCE_STRING = "/" + TEST_RESOURCE; + + private static final double EPSILON = 0.000001; + + @Before + public void setup() throws JAXBException { + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryAllProperty.class}); + + prepareEditingDomain(); + concept = loadConceptFromPlugin(); + + tcAllProperty = new TestCategoryAllProperty(concept); + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllProperty); + JsonTestHelper.createRepositoryWithUnitManagement(concept); + } + + /** + * Set the new values + */ + public void initProperties() { + tcAllProperty.setTestInt(TEST_INT); + tcAllProperty.setTestFloat(TEST_FLOAT); + tcAllProperty.setTestEnum(TEST_ENUM); + tcAllProperty.setTestResource(URI.createPlatformPluginURI(TEST_RESOURCE, false)); + tcAllProperty.setTestString(TEST_STRING); + tcAllProperty.setTestBool(TEST_BOOL); + } + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + initProperties(); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE_WITH_VALUES, tcAllProperty); + } + + @Test + public void testJsonMarshallingWithDefaultValues() throws JAXBException, IOException { + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE_WITH_DEFAULTS, tcAllProperty); + } + + /** + * Unmarshall the resource + * @param resource containing the input JSON + * @throws JAXBException + * @throws IOException + */ + public void unmarshalWithResource(String resource) throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcAllProperty.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(resource); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryAllProperty.class); + } + + @Test + public void testJsonUnmarshalling() throws JAXBException, IOException { + // Initial default values are set + assertEqualsDefaultValues(); + + // Unmarshall the resource containing the new values + unmarshalWithResource(RESOURCE_WITH_VALUES); + + // The values are correctly overwritten + assertEqualsTestValues(); + + // Unmarshall again to test idempotency + unmarshalWithResource(RESOURCE_WITH_VALUES); + assertEqualsTestValues(); + } + + @Test + public void testJsonUnmarshallingWithDefaultValues() throws JAXBException, IOException { + // Set to the new values + initProperties(); + assertEqualsTestValues(); + + // Unmarshall the resource containing the default values + unmarshalWithResource(RESOURCE_WITH_DEFAULTS); + + // The values are correctly overwritten + assertEqualsDefaultValues(); + } + + /** + * Assert that the new values are set correctly + */ + private void assertEqualsTestValues() { + assertEquals(TEST_INT, tcAllProperty.getTestInt()); + assertEquals(TEST_STRING, tcAllProperty.getTestString()); + assertEquals(TEST_RESOURCE_STRING, tcAllProperty.getTestResource().toPlatformString(false)); + assertEquals(TEST_ENUM, tcAllProperty.getTestEnum()); + assertEquals(TEST_BOOL, tcAllProperty.getTestBool()); + assertEquals(TEST_FLOAT, tcAllProperty.getTestFloat(), EPSILON); + } + + /** + * Assert that the default values are set correctly + */ + private void assertEqualsDefaultValues() { + assertNull(tcAllProperty.getTestIntBean().getTypeInstance().getValue()); + assertNull(tcAllProperty.getTestString()); + assertNull(tcAllProperty.getTestEnum()); + assertNull(tcAllProperty.getTestResource()); + assertFalse(tcAllProperty.getTestBool()); + assertTrue(Double.isNaN(tcAllProperty.getTestFloat())); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryBeanATest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryBeanATest.java new file mode 100644 index 0000000000..b46e3fdc83 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryBeanATest.java @@ -0,0 +1,71 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryBeanA; + +public class TestCategoryBeanATest extends AConceptTestCase { + + private static final String UUID = "f34d30b0-80f5-4c96-864f-29ab4d3ae9f2"; + private static final String RESOURCE = "/resources/json/TestCategoryBeanA_Marshaling.json"; + private JAXBUtility jaxbUtility; + private TestCategoryBeanA tcBeanA; + private Concept concept; + + @Before + public void setUp() throws Exception { + concept = loadConceptFromPlugin(); + + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryBeanA.class}); + + tcBeanA = new TestCategoryBeanA(concept); + tcBeanA.getTypeInstance().setUuid(new VirSatUuid(UUID)); + } + + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE, tcBeanA); + } + + @Test + public void testJsonUnMarshalling() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcBeanA.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + + TestCategoryBeanA createdBeanA = jsonUnmarshaller.unmarshal(inputSource, TestCategoryBeanA.class).getValue(); + assertEquals(tcBeanA, createdBeanA); + + // Unmarshall again to test idempotency + inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + createdBeanA = jsonUnmarshaller.unmarshal(inputSource, TestCategoryBeanA.class).getValue(); + assertEquals(tcBeanA, createdBeanA); + } + +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryCompositionArrayTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryCompositionArrayTest.java new file mode 100644 index 0000000000..76ce52c3b6 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryCompositionArrayTest.java @@ -0,0 +1,161 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesFactory; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryCompositionArray; + +public class TestCategoryCompositionArrayTest extends AConceptTestCase { + + private TestCategoryCompositionArray tcCompositionArray; + private JAXBUtility jaxbUtility; + private Concept concept; + private TestCategoryAllProperty tcAllProperty; + private BeanPropertyComposed composedBean; + private static final String RESOURCE = "/resources/json/TestCategoryCompositionArray_Marshaling.json"; + private static final String RESOURCE_NULL_COMPOSITION = "/resources/json/TestCategoryCompositionArray_Marshaling_NullComposition.json"; + private static final String RESOURCE_CHANGE_ELEMENT = "/resources/json/TestCategoryCompositionArray_Marshaling_ChangeElement.json"; + + @Before + public void setup() throws JAXBException { + // Because a composed bean is generic we need an adapter + // And because of the adapter we have to manually add the composed + // classes to the marshaller. + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryCompositionArray.class, TestCategoryAllProperty.class}); + + // Load the concept to create the test object + prepareEditingDomain(); + concept = loadConceptFromPlugin(); + tcCompositionArray = new TestCategoryCompositionArray(concept); + + tcCompositionArray.getATypeInstance().setUuid(new VirSatUuid("f5d016ac-65fa-4b9d-ae94-582d4f73138a")); + IBeanList> staticArray = tcCompositionArray.getTestCompositionArrayStaticBean(); + for (int i = 0; i < staticArray.size(); i++) { + BeanPropertyComposed bean = staticArray.get(i); + bean.getATypeInstance().setUuid(new VirSatUuid("45e18c9d-ef85-4ab8-ba2a-c5916697a0b" + i)); + + TestCategoryAllProperty tcAllProperty = bean.getValue(); + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllProperty, i); + } + + tcAllProperty = new TestCategoryAllProperty(concept); + // Prior numbers for UUIDs are already taken so we use the next free one here + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllProperty, staticArray.size()); + + // For composed / reference beans the wrapping beans + // have to exist because else adding a new element to + // the dynamic list in the unmarshalling fails + ComposedPropertyInstance cpi = PropertyinstancesFactory.eINSTANCE.createComposedPropertyInstance(); + composedBean = new BeanPropertyComposed(cpi); + cpi.setUuid(new VirSatUuid("25ed5be7-de0d-4672-95be-8ccce3a7e2e2")); + // Can't set this via the bean + cpi.setTypeInstance(tcAllProperty.getTypeInstance()); + + JsonTestHelper.createRepositoryWithUnitManagement(concept); + } + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + tcCompositionArray.getTestCompositionArrayStatic().get(0).getTestStringBean().setValue(JsonTestHelper.TEST_STRING); + // Use the bean list here to force the wanted bean (to reuse the same resource as for unmarshalling) + tcCompositionArray.getTestCompositionArrayDynamicBean().add(composedBean); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE, tcCompositionArray); + } + + @Test + public void testJsonUnmarshalling() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcCompositionArray.getATypeInstance(), + composedBean.getATypeInstance(), + tcAllProperty.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + + assertNull(tcCompositionArray.getTestCompositionArrayStatic().get(0).getTestStringBean().getValue()); + assertEquals("Initial no dynamic element", 0, tcCompositionArray.getTestCompositionArrayDynamic().size()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryCompositionArray.class); + + assertEquals(JsonTestHelper.TEST_STRING, tcCompositionArray.getTestCompositionArrayStatic().get(0).getTestStringBean().getValue()); + assertEquals("Element added successfully", 1, tcCompositionArray.getTestCompositionArrayDynamic().size()); + + // Unmarshall again to test idempotency + inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + jsonUnmarshaller.unmarshal(inputSource, TestCategoryCompositionArray.class); + assertEquals("Same element not added again", 1, tcCompositionArray.getTestCompositionArrayDynamic().size()); + } + + @Test + public void testJsonUnmarshallingChangeWholeElement() throws JAXBException, IOException { + TestCategoryAllProperty tcAllPropertyNew = new TestCategoryAllProperty(concept); + final int LAST_NUMBER = 9; + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllPropertyNew, LAST_NUMBER); + + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcCompositionArray.getATypeInstance(), + tcAllPropertyNew.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_CHANGE_ELEMENT); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryCompositionArray.class); + + // The set value function of the bean doesn't have any effect at the moment + assertNotEquals("No new element set", tcAllPropertyNew.getATypeInstance().getUuid(), tcCompositionArray.getTestCompositionArrayStatic().get(0).getUuid()); + } + + @Test + public void testJsonMarshallingNull() throws JAXBException, IOException { + tcCompositionArray.getTestCompositionArrayStaticBean().get(0).getTypeInstance().setTypeInstance(null); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE_NULL_COMPOSITION, tcCompositionArray); + } + + @Test + public void testJsonUnmarshallingNull() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcCompositionArray.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_NULL_COMPOSITION); + + assertNotNull(tcCompositionArray.getTestCompositionArrayStatic().get(0)); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryCompositionArray.class); + + // The set value function of the bean doesn't have any effect at the moment + assertNotNull(tcCompositionArray.getTestCompositionArrayStatic().get(0)); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryCompositionTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryCompositionTest.java new file mode 100644 index 0000000000..1a42c68680 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryCompositionTest.java @@ -0,0 +1,109 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryComposition; + +public class TestCategoryCompositionTest extends AConceptTestCase { + + private JAXBUtility jaxbUtility; + private TestCategoryComposition tcComposition; + private TestCategoryAllProperty tcAllProperty; + private Concept concept; + + private static final String RESOURCE = "/resources/json/TestCategoryComposition_Marshaling.json"; + private static final String RESOURCE_NULL_COMPOSITION = "/resources/json/TestCategoryComposition_Marshaling_NullComposition.json"; + + @Before + public void setup() throws JAXBException { + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryComposition.class}); + + concept = loadConceptFromPlugin(); + + tcComposition = new TestCategoryComposition(concept); + tcComposition.getATypeInstance().setUuid(new VirSatUuid("028a6e1b-e7c4-4937-886b-d65452426bfd")); + tcComposition.getTestSubCategoryBean().getATypeInstance().setUuid(new VirSatUuid("128a6e1b-e7c4-4937-886b-d65452426bfd")); + + tcAllProperty = tcComposition.getTestSubCategory(); + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllProperty); + JsonTestHelper.createRepositoryWithUnitManagement(concept); + } + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + tcAllProperty.setTestString(JsonTestHelper.TEST_STRING); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE, tcComposition); + } + + @Test + public void testJsonUnmarshalling() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcComposition.getATypeInstance(), + tcAllProperty.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + + assertNull(tcAllProperty.getTestString()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryComposition.class); + + assertEquals("Composed element changed", JsonTestHelper.TEST_STRING, tcComposition.getTestSubCategory().getTestString()); + + // Unmarshall again to test idempotency + inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + jsonUnmarshaller.unmarshal(inputSource, TestCategoryComposition.class); + assertEquals("Composed element is still the same", JsonTestHelper.TEST_STRING, tcComposition.getTestSubCategory().getTestString()); + } + + @Test + public void testJsonMarshallingNull() throws JAXBException, IOException { + tcComposition.getTestSubCategoryBean().getTypeInstance().setTypeInstance(null); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE_NULL_COMPOSITION, tcComposition); + } + + @Test + public void testJsonUnmarshallingNull() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcComposition.getATypeInstance(), + tcAllProperty.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_NULL_COMPOSITION); + + assertNotNull(tcComposition.getTestSubCategory()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryComposition.class); + + // Composed bean can't change the composed element + assertNotNull("No error was thrown and the model didn't change", tcComposition.getTestSubCategory()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryIntrinsicArrayTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryIntrinsicArrayTest.java new file mode 100644 index 0000000000..bb41ed7f02 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryIntrinsicArrayTest.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.extension.tests.model.ATestCategoryIntrinsicArrayTest; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryIntrinsicArray; + +public class TestCategoryIntrinsicArrayTest extends ATestCategoryIntrinsicArrayTest { + + private JAXBUtility jaxbUtility; + private BeanPropertyString bpString; + private TestCategoryIntrinsicArray tcIntrinsicArray; + + private static final String RESOURCE = "/resources/json/TestCategoryIntrinsicArray_Marshaling.json"; + + @Before + public void setUp() throws Exception { + super.setUp(); + + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryIntrinsicArray.class}); + + bpString = JsonTestHelper.createTestStringBean(concept); + + tcIntrinsicArray = new TestCategoryIntrinsicArray(concept); + tcIntrinsicArray.getTypeInstance().setUuid(new VirSatUuid("f34d30b0-80f5-4c96-864f-29ab4d3ae9f2")); + tcIntrinsicArray.getTestStringArrayDynamicBean().getArrayInstance().setUuid(new VirSatUuid("ee6e1025-4a77-4b32-9c62-cb459ed76ce8")); + IBeanList list = tcIntrinsicArray.getTestStringArrayStaticBean(); + JsonTestHelper.setStaticIBeanListUuids(list); + } + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + bpString.setValue(JsonTestHelper.TEST_STRING); + + tcIntrinsicArray.getTestStringArrayStaticBean().get(0).setValue(JsonTestHelper.TEST_STRING); + tcIntrinsicArray.getTestStringArrayDynamicBean().add(bpString); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE, tcIntrinsicArray); + } + + @Test + public void testJsonUnmarshalling() throws JAXBException, IOException { + ArrayInstance originalArrayInstance = tcIntrinsicArray.getTestStringArrayStaticBean().getArrayInstance(); + + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcIntrinsicArray.getATypeInstance(), + originalArrayInstance, + bpString.getATypeInstance() + )); + + assertNull(tcIntrinsicArray.getTestStringArrayStaticBean().get(0).getValue()); + assertEquals(tcIntrinsicArray.getTestStringArrayDynamicBean().size(), 0); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryIntrinsicArray.class); + assertEquals("Element in static element changed", JsonTestHelper.TEST_STRING, tcIntrinsicArray.getTestStringArrayStaticBean().get(0).getValue()); + assertEquals("Successfully added an element", 1, tcIntrinsicArray.getTestStringArrayDynamicBean().size()); + + // Unmarshall again to test idempotency + inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + jsonUnmarshaller.unmarshal(inputSource, TestCategoryIntrinsicArray.class); + assertEquals("Element in static is still the same", JsonTestHelper.TEST_STRING, tcIntrinsicArray.getTestStringArrayStaticBean().get(0).getValue()); + assertEquals("Still only one element is present", 1, tcIntrinsicArray.getTestStringArrayDynamicBean().size()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryReferenceArrayTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryReferenceArrayTest.java new file mode 100644 index 0000000000..98d5ad7d47 --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryReferenceArrayTest.java @@ -0,0 +1,194 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.concept.list.IBeanList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesFactory; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryReferenceArray; + +public class TestCategoryReferenceArrayTest extends AConceptTestCase { + + private TestCategoryReferenceArray tcReferenceArray; + private JAXBUtility jaxbUtility; + private Concept concept; + private BeanPropertyString bpString; + private TestCategoryAllProperty tcAllProperty; + private BeanPropertyReference refPropBean; + private BeanPropertyReference refCatBean; + private static final String RESOURCE = "/resources/json/TestCategoryReferenceArray_Marshaling.json"; + private static final String RESOURCE_NULL_REFERENCE = "/resources/json/TestCategoryReferenceArray_Marshaling_NullReference.json"; + private static final String RESOURCE_CHANGED_REFERENCE = "/resources/json/TestCategoryReferenceArray_Marshaling_ChangeReference.json"; + + @Before + public void setup() throws JAXBException { + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryReferenceArray.class}); + + // Load the concept to create the test object + prepareEditingDomain(); + concept = loadConceptFromPlugin(); + tcReferenceArray = new TestCategoryReferenceArray(concept); + + tcAllProperty = new TestCategoryAllProperty(concept); + + // Set uuids to match the test resource + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllProperty); + + bpString = JsonTestHelper.createTestStringBean(concept); + + tcReferenceArray.getTypeInstance().setUuid(new VirSatUuid("f34d30b0-80f5-4c96-864f-29ab4d3ae9f2")); + + IBeanList> staticCategoryArray = tcReferenceArray.getTestCategoryReferenceArrayStaticBean(); + for (int i = 0; i < staticCategoryArray.size(); i++) { + BeanPropertyReference bean = staticCategoryArray.get(i); + bean.getATypeInstance().setUuid(new VirSatUuid("8872b433-968c-4f48-b9a3-d734c6e239a" + i)); + + bean.setValue(tcAllProperty); + } + + IBeanList> staticPropertyArray = tcReferenceArray.getTestPropertyReferenceArrayStaticBean(); + for (int i = 0; i < staticPropertyArray.size(); i++) { + BeanPropertyReference bean = staticPropertyArray.get(i); + bean.getATypeInstance().setUuid(new VirSatUuid("49177554-f1e4-4529-bf1b-3036abb1ee3" + i)); + + bean.setValue(bpString); + } + + // For composed / reference beans the wrapping beans + // have to exist because else adding a new element to + // the dynamic list in the unmarshalling fails + ReferencePropertyInstance rpi = PropertyinstancesFactory.eINSTANCE.createReferencePropertyInstance(); + refPropBean = new BeanPropertyReference(rpi); + rpi.setUuid(new VirSatUuid("f8932f09-71b7-40b6-bcbd-5d71c2b8d6d7")); + refPropBean.setValue(bpString); + + ReferencePropertyInstance rpi2 = PropertyinstancesFactory.eINSTANCE.createReferencePropertyInstance(); + refCatBean = new BeanPropertyReference(rpi2); + rpi2.setUuid(new VirSatUuid("0544cfe4-ec11-4585-8f1b-e875e26ae33c")); + refCatBean.setValue(tcAllProperty); + } + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + // Use the bean list here to force the wanted bean (to reuse the same resource as for unmarshalling) + tcReferenceArray.getTestCategoryReferenceArrayDynamicBean().add(refCatBean); + tcReferenceArray.getTestPropertyReferenceArrayDynamicBean().add(refPropBean); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE, tcReferenceArray); + } + + @Test + public void testJsonUnmarshalling() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcReferenceArray.getATypeInstance(), + tcAllProperty.getATypeInstance(), + bpString.getATypeInstance(), + refCatBean.getATypeInstance(), + refPropBean.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + + assertEquals("Initial no dynamic element", 0, tcReferenceArray.getTestPropertyReferenceArrayDynamic().size()); + assertEquals("Initial no dynamic element", 0, tcReferenceArray.getTestCategoryReferenceArrayDynamic().size()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReferenceArray.class); + + assertEquals("Element added successfully", 1, tcReferenceArray.getTestPropertyReferenceArrayDynamic().size()); + assertEquals("Element added successfully", 1, tcReferenceArray.getTestCategoryReferenceArrayDynamic().size()); + + // Unmarshall again to test idempotency + inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE); + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReferenceArray.class); + assertEquals("Same element not added again", 1, tcReferenceArray.getTestPropertyReferenceArrayDynamic().size()); + assertEquals("Same element not added again", 1, tcReferenceArray.getTestCategoryReferenceArrayDynamic().size()); + + } + + @Test + public void testJsonUnmarshallingChangeReference() throws JAXBException, IOException { + TestCategoryAllProperty tcAllProperty2 = new TestCategoryAllProperty(concept); + tcAllProperty2.getATypeInstance().setUuid(new VirSatUuid("134d30b0-80f5-4c96-864f-29ab4d3ae9f0")); + + BeanPropertyString bpString2 = tcAllProperty2.getTestStringBean(); + bpString2.getATypeInstance().setUuid(new VirSatUuid("1256e7a2-9a1f-443c-85f8-7b766eac3f50")); + + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcReferenceArray.getATypeInstance(), + tcAllProperty.getATypeInstance(), + bpString.getATypeInstance(), + tcAllProperty2.getATypeInstance(), + bpString2.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_CHANGED_REFERENCE); + + assertEquals(bpString.getUuid(), tcReferenceArray.getTestPropertyReferenceArrayStatic().get(0).getUuid()); + assertEquals(tcAllProperty.getUuid(), tcReferenceArray.getTestCategoryReferenceArrayStatic().get(0).getUuid()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReferenceArray.class); + + assertEquals("Referenced bean changed successfully", bpString2.getUuid(), tcReferenceArray.getTestPropertyReferenceArrayStatic().get(0).getUuid()); + assertEquals("Referenced bean changed successfully", tcAllProperty2.getUuid(), tcReferenceArray.getTestCategoryReferenceArrayStatic().get(0).getUuid()); + } + + @Test + public void testJsonMarshallingNull() throws JAXBException, IOException { + tcReferenceArray.getTestCategoryReferenceArrayStaticBean().get(0).setValue(null); + tcReferenceArray.getTestPropertyReferenceArrayStaticBean().get(0).setValue(null); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE_NULL_REFERENCE, tcReferenceArray); + } + + @Test + public void testJsonUnmarshallingNull() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcReferenceArray.getATypeInstance(), + tcAllProperty.getATypeInstance(), + bpString.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_NULL_REFERENCE); + + assertNotNull(tcReferenceArray.getTestCategoryReferenceArrayStaticBean().get(0).getValue()); + assertNotNull(tcReferenceArray.getTestPropertyReferenceArrayStaticBean().get(0).getValue()); + assertNotNull(tcReferenceArray.getTestCategoryReferenceArrayStatic().get(0)); + assertNotNull(tcReferenceArray.getTestPropertyReferenceArrayStatic().get(0)); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReferenceArray.class); + + assertNull(tcReferenceArray.getTestCategoryReferenceArrayStaticBean().get(0).getValue()); + assertNull(tcReferenceArray.getTestPropertyReferenceArrayStaticBean().get(0).getValue()); + // Currently this list will return a ca without a type instance + assertNull(tcReferenceArray.getTestCategoryReferenceArrayStatic().get(0).getTypeInstance()); + assertNull(tcReferenceArray.getTestPropertyReferenceArrayStatic().get(0).getTypeInstance()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryReferenceTest.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryReferenceTest.java new file mode 100644 index 0000000000..9e34c0801a --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/model/json/TestCategoryReferenceTest.java @@ -0,0 +1,131 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.model.json; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +import java.io.IOException; +import java.util.Arrays; + +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import javax.xml.transform.stream.StreamSource; + +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.json.JAXBUtility; +import de.dlr.sc.virsat.model.dvlm.types.impl.VirSatUuid; +import de.dlr.sc.virsat.model.extension.tests.model.AConceptTestCase; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryReference; + +public class TestCategoryReferenceTest extends AConceptTestCase { + + private TestCategoryReference tcReference; + private JAXBUtility jaxbUtility; + private Concept concept; + private BeanPropertyString bpString; + private BeanPropertyReference refCatBean; + private TestCategoryAllProperty tcAllProperty; + private BeanPropertyReference refPropBean; + + private static final String RESOURCE = "/resources/json/TestCategoryReference_Marshaling.json"; + private static final String RESOURCE_NULL_REFERENCE = "/resources/json/TestCategoryReference_Marshaling_NullReference.json"; + private static final String RESOURCE_CHANGED_REFERENCE = "/resources/json/TestCategoryReference_Marshaling_ChangeReference.json"; + + @Before + public void setup() throws JAXBException { + jaxbUtility = new JAXBUtility(new Class[] {TestCategoryReference.class}); + + concept = loadConceptFromPlugin(); + tcReference = new TestCategoryReference(concept); + tcReference.getATypeInstance().setUuid(new VirSatUuid("0370d14d-e6a1-4660-83f1-5bb98fa840ac")); + + bpString = JsonTestHelper.createTestStringBean(concept); + tcReference.setTestRefProperty(bpString); + + refPropBean = tcReference.getTestRefPropertyBean(); + refPropBean.getATypeInstance().setUuid(new VirSatUuid("0dee3e78-fbcd-4294-8dba-5fa3d4760249")); + + refCatBean = tcReference.getTestRefCategoryBean(); + refCatBean.getATypeInstance().setUuid(new VirSatUuid("f34d30b0-80f5-4c96-864f-29ab4d3ae9f2")); + tcAllProperty = new TestCategoryAllProperty(concept); + JsonTestHelper.setTestCategoryAllPropertyUuids(tcAllProperty); + JsonTestHelper.createRepositoryWithUnitManagement(concept); + + bpString.setValue(JsonTestHelper.TEST_STRING); + tcReference.setTestRefCategory(tcAllProperty); + } + + @Test + public void testJsonMarshalling() throws JAXBException, IOException { + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE, tcReference); + } + + @Test + public void testJsonUnmarshalling() throws JAXBException, IOException { + BeanPropertyString bpString2 = new TestCategoryAllProperty(concept).getTestStringBean(); + bpString2.getATypeInstance().setUuid(new VirSatUuid("1256e7a2-9a1f-443c-85f8-7b766eac3f50")); + + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcReference.getATypeInstance(), + bpString.getATypeInstance(), + bpString2.getATypeInstance(), + refCatBean.getATypeInstance(), + tcAllProperty.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_CHANGED_REFERENCE); + + assertEquals(bpString.getUuid(), tcReference.getTestRefProperty().getUuid()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReference.class); + + assertEquals("Referenced bean changed successfully", bpString2.getUuid(), tcReference.getTestRefProperty().getUuid()); + + // Unmarshall again to test idempotency + inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_CHANGED_REFERENCE); + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReference.class); + assertEquals("Referenced is still the same", bpString2.getUuid(), tcReference.getTestRefProperty().getUuid()); + } + + @Test + public void testJsonMarshallingNull() throws JAXBException, IOException { + + tcReference.setTestRefProperty(null); + tcReference.setTestRefCategory(null); + + JsonTestHelper.assertMarshall(jaxbUtility, RESOURCE_NULL_REFERENCE, tcReference); + } + + @Test + public void testJsonUnmarshallingNull() throws JAXBException, IOException { + Unmarshaller jsonUnmarshaller = JsonTestHelper.getUnmarshaller(jaxbUtility, Arrays.asList( + tcReference.getATypeInstance() + )); + + StreamSource inputSource = JsonTestHelper.getResourceAsStreamSource(RESOURCE_NULL_REFERENCE); + + assertNotNull(tcReference.getTestRefCategory()); + assertNotNull(tcReference.getTestRefProperty()); + + jsonUnmarshaller.unmarshal(inputSource, TestCategoryReference.class); + + assertNull("Refernce set to null", tcReference.getTestRefCategory()); + assertNull("Refernce set to null", tcReference.getTestRefProperty()); + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/AllTests.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/AllTests.java index 4d7ce84762..16c60ccd82 100644 --- a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/AllTests.java +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/AllTests.java @@ -79,7 +79,14 @@ MatImporterTest.class, MatExporterTest.class, BeanPropertyReferenceTest.class, - ReferenceUpdateTest.class + ReferenceUpdateTest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryAllPropertyTest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryBeanATest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryIntrinsicArrayTest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryCompositionTest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryReferenceTest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryCompositionArrayTest.class, + de.dlr.sc.virsat.model.extension.tests.model.json.TestCategoryReferenceArrayTest.class }) /** diff --git a/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/TestActivator.java b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/TestActivator.java new file mode 100644 index 0000000000..9509dafb7b --- /dev/null +++ b/de.dlr.sc.virsat.model.extension.tests.test/src/de/dlr/sc/virsat/model/extension/tests/test/TestActivator.java @@ -0,0 +1,68 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.model.extension.tests.test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; + +import org.junit.Assert; + +public class TestActivator { + + + /** + * Hidden construcotr of activator class + */ + private TestActivator() { + } + + public static final String FRAGMENT_ID = "de.dlr.sc.virsat.model.extension.tests.test"; + + /** + * Method to access the fragments contents from the resource folder and to ahnd it back as string + * @param resourcePath the path to the resource starting with "resource/" + * @return the content of the resource as string + * @throws IOException throws + */ + public static String getResourceContentAsString(String resourcePath) throws IOException { + URL url = new URL("platform:/plugin/" + FRAGMENT_ID + resourcePath); + InputStream inputStream = url.openConnection().getInputStream(); + + StringBuilder fileContent = new StringBuilder(); + try (BufferedReader in = new BufferedReader(new InputStreamReader(inputStream))) { + String inputLine; + + while ((inputLine = in.readLine()) != null) { + fileContent.append(inputLine); + fileContent.append(System.lineSeparator()); + } + } + + return fileContent.toString(); + } + + /** + * Assert a message after removing new line at end of file + * @param message + * @param expected + * @param actual + */ + public static void assertEqualsNoWs(String message, String expected, String actual) { + String expectedNoWs = expected.replaceAll("\\s+", ""); + String actualNoWs = actual.replaceAll("\\s+", ""); + + if (!expectedNoWs.equals(actualNoWs)) { + Assert.assertEquals(message, expected, actual); + } + } +} diff --git a/de.dlr.sc.virsat.model.extension.tests.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.tests.ui/META-INF/MANIFEST.MF index 02311b36ad..acecf116b3 100644 --- a/de.dlr.sc.virsat.model.extension.tests.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.tests.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Test Concept UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.tests.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.tests, org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.tests.ui/build.properties b/de.dlr.sc.virsat.model.extension.tests.ui/build.properties index 542599a90c..eb8d696366 100644 --- a/de.dlr.sc.virsat.model.extension.tests.ui/build.properties +++ b/de.dlr.sc.virsat.model.extension.tests.ui/build.properties @@ -5,5 +5,5 @@ output.. = target/classes/ bin.includes = META-INF/,\ .,\ plugin.xml,\ - resources/ - + resources/,\ + about.html diff --git a/de.dlr.sc.virsat.model.extension.tests.ui/pom.xml b/de.dlr.sc.virsat.model.extension.tests.ui/pom.xml index c3ffebb565..b604855e4a 100644 --- a/de.dlr.sc.virsat.model.extension.tests.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.tests.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.tests/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.tests/META-INF/MANIFEST.MF index 2da89babb1..bdfefc578a 100644 --- a/de.dlr.sc.virsat.model.extension.tests/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.tests/META-INF/MANIFEST.MF @@ -1,11 +1,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName +Bundle-Name: VirSat Core Model Extension Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.tests;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . -Bundle-Vendor: %providerName -Bundle-Localization: plugin +Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, diff --git a/de.dlr.sc.virsat.model.extension.tests/build.properties b/de.dlr.sc.virsat.model.extension.tests/build.properties index 9068b51c7e..428202c1dc 100644 --- a/de.dlr.sc.virsat.model.extension.tests/build.properties +++ b/de.dlr.sc.virsat.model.extension.tests/build.properties @@ -8,8 +8,7 @@ bin.includes = META-INF/,\ .,\ plugin.xml,\ concept/,\ - about.html,\ - plugin.properties + about.html additional.bundles = org.eclipse.emf.mwe2.runtime,\ org.eclipse.xtend.typesystem.emf,\ org.eclipse.xpand,\ diff --git a/de.dlr.sc.virsat.model.extension.tests/plugin.properties b/de.dlr.sc.virsat.model.extension.tests/plugin.properties deleted file mode 100644 index 37cef21ce1..0000000000 --- a/de.dlr.sc.virsat.model.extension.tests/plugin.properties +++ /dev/null @@ -1,2 +0,0 @@ -pluginName = Concept Model -providerName = www.example.org diff --git a/de.dlr.sc.virsat.model.extension.tests/pom.xml b/de.dlr.sc.virsat.model.extension.tests/pom.xml index 3552d19191..300136da69 100644 --- a/de.dlr.sc.virsat.model.extension.tests/pom.xml +++ b/de.dlr.sc.virsat.model.extension.tests/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/AEReferenceTest.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/AEReferenceTest.java index 921c5f174b..44d91e18e7 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/AEReferenceTest.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/AEReferenceTest.java @@ -12,17 +12,20 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEReference; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import org.eclipse.emf.common.command.Command; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.external.tests.ExternalTestType; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; @@ -38,6 +41,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AEReferenceTest extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.EReferenceTest"; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryAllProperty.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryAllProperty.java index 157c94863d..732e21a8e6 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryAllProperty.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryAllProperty.java @@ -12,15 +12,18 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.util.URI; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ResourcePropertyInstance; import org.eclipse.emf.edit.domain.EditingDomain; @@ -31,6 +34,7 @@ import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyResource; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyInt; @@ -46,6 +50,8 @@ * TestCategory for testing all property Types once * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryAllProperty extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryAllProperty"; @@ -122,6 +128,7 @@ public String getTestString() { return testString.getValue(); } + @XmlElement public BeanPropertyString getTestStringBean() { safeAccessTestString(); return testString; @@ -158,6 +165,7 @@ public boolean isSetTestInt() { return testInt.isSet(); } + @XmlElement public BeanPropertyInt getTestIntBean() { safeAccessTestInt(); return testInt; @@ -194,6 +202,7 @@ public boolean isSetTestFloat() { return testFloat.isSet(); } + @XmlElement public BeanPropertyFloat getTestFloatBean() { safeAccessTestFloat(); return testFloat; @@ -225,6 +234,7 @@ public boolean getTestBool() { return testBool.getValue(); } + @XmlElement public BeanPropertyBoolean getTestBoolBean() { safeAccessTestBool(); return testBool; @@ -256,6 +266,7 @@ public URI getTestResource() { return testResource.getValue(); } + @XmlElement public BeanPropertyResource getTestResourceBean() { safeAccessTestResource(); return testResource; @@ -292,6 +303,7 @@ public double getTestEnumEnum() { return testEnum.getEnumValue(); } + @XmlElement public BeanPropertyEnum getTestEnumBean() { safeAccessTestEnum(); return testEnum; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBase.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBase.java index 8c3a02c7f4..5cde0892f1 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBase.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBase.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; @@ -25,10 +28,13 @@ import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyInt; @@ -44,6 +50,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryBase extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryBase"; @@ -105,6 +113,7 @@ private void safeAccessTestArrayBean() { } } + @XmlElement public IBeanList> getTestArrayBean() { safeAccessTestArrayBean(); return testArrayBean; @@ -141,6 +150,7 @@ public boolean isSetTestBaseProperty() { return testBaseProperty.isSet(); } + @XmlElement public BeanPropertyInt getTestBasePropertyBean() { safeAccessTestBaseProperty(); return testBaseProperty; @@ -156,6 +166,8 @@ private void safeAccessTestReference() { testReference.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public TestCategoryBase getTestReference() { safeAccessTestReference(); return testReference.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanA.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanA.java index c9fc2ba89a..1ef37737bd 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanA.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanA.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryBeanA extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryBeanA"; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanAbstract.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanAbstract.java index f77e110320..d8afea8e0c 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanAbstract.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanAbstract.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryBeanAbstract extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryBeanAbstract"; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanB.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanB.java index 17eeaad299..0c8027db55 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanB.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanB.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -33,6 +36,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryBeanB extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryBeanB"; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanConcrete.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanConcrete.java index 7208d2d132..2693485897 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanConcrete.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryBeanConcrete.java @@ -12,12 +12,15 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; // ***************************************************************** @@ -32,6 +35,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryBeanConcrete extends TestCategoryBeanAbstract implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryBeanConcrete"; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryComposition.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryComposition.java index 50ea9f4b12..e67af60983 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryComposition.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryComposition.java @@ -12,15 +12,19 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -35,6 +39,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryComposition extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryComposition"; @@ -82,6 +88,7 @@ private void safeAccessTestSubCategory() { } } + @XmlElement(nillable = true) public TestCategoryAllProperty getTestSubCategory() { safeAccessTestSubCategory(); return testSubCategory.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryCompositionArray.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryCompositionArray.java index 9935658bb9..88405ba6ac 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryCompositionArray.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryCompositionArray.java @@ -12,18 +12,22 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; -import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; -import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyBeanList; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import de.dlr.sc.virsat.model.concept.list.TypeSafeComposedPropertyInstanceList; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -38,6 +42,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryCompositionArray extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryCompositionArray"; @@ -98,6 +104,7 @@ private void safeAccessTestCompositionArrayDynamicBean() { } } + @XmlElement public IBeanList> getTestCompositionArrayDynamicBean() { safeAccessTestCompositionArrayDynamicBean(); return testCompositionArrayDynamicBean; @@ -127,6 +134,7 @@ private void safeAccessTestCompositionArrayStaticBean() { } } + @XmlElement public IBeanList> getTestCompositionArrayStaticBean() { safeAccessTestCompositionArrayStaticBean(); return testCompositionArrayStaticBean; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryExtends.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryExtends.java index c9de60064a..74eee9b269 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryExtends.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryExtends.java @@ -12,16 +12,20 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyInt; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -36,6 +40,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryExtends extends TestCategoryBase implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryExtends"; @@ -102,6 +108,7 @@ public boolean isSetTestExtendsProperty() { return testExtendsProperty.isSet(); } + @XmlElement public BeanPropertyInt getTestExtendsPropertyBean() { safeAccessTestExtendsProperty(); return testExtendsProperty; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryIntrinsicArray.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryIntrinsicArray.java index 4f9fd8e60c..f3300b3c48 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryIntrinsicArray.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryIntrinsicArray.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.list.TypeSafeArrayInstanceList; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryIntrinsicArray extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryIntrinsicArray"; @@ -84,6 +90,7 @@ private void safeAccessTestStringArrayDynamicBean() { } } + @XmlElement public IBeanList getTestStringArrayDynamicBean() { safeAccessTestStringArrayDynamicBean(); return testStringArrayDynamicBean; @@ -100,6 +107,7 @@ private void safeAccessTestStringArrayStaticBean() { } } + @XmlElement public IBeanList getTestStringArrayStaticBean() { safeAccessTestStringArrayStaticBean(); return testStringArrayStaticBean; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReference.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReference.java index 5e12cedfc8..656464c532 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReference.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReference.java @@ -12,18 +12,24 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; -import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import org.eclipse.emf.common.command.Command; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyString; -import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ReferencePropertyInstance; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.common.command.Command; +import de.dlr.sc.virsat.model.dvlm.json.ABeanObjectAdapter; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -38,6 +44,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryReference extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryReference"; @@ -84,6 +92,8 @@ private void safeAccessTestRefCategory() { testRefCategory.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public TestCategoryAllProperty getTestRefCategory() { safeAccessTestRefCategory(); return testRefCategory.getValue(); @@ -114,6 +124,8 @@ private void safeAccessTestRefProperty() { testRefProperty.setTypeInstance(propertyInstance); } + @XmlElement(nillable = true) + @XmlJavaTypeAdapter(ABeanObjectAdapter.class) public BeanPropertyString getTestRefProperty() { safeAccessTestRefProperty(); return testRefProperty.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReferenceArray.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReferenceArray.java index 045bae4656..8ad2224be2 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReferenceArray.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCategoryReferenceArray.java @@ -12,18 +12,22 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; -import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; -import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyBeanList; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.concept.list.IBeanList; import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ArrayInstance; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyReference; +import de.dlr.sc.virsat.model.concept.list.TypeSafeReferencePropertyInstanceList; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -38,6 +42,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCategoryReferenceArray extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCategoryReferenceArray"; @@ -100,6 +106,7 @@ private void safeAccessTestCategoryReferenceArrayDynamicBean() { } } + @XmlElement public IBeanList> getTestCategoryReferenceArrayDynamicBean() { safeAccessTestCategoryReferenceArrayDynamicBean(); return testCategoryReferenceArrayDynamicBean; @@ -129,6 +136,7 @@ private void safeAccessTestCategoryReferenceArrayStaticBean() { } } + @XmlElement public IBeanList> getTestCategoryReferenceArrayStaticBean() { safeAccessTestCategoryReferenceArrayStaticBean(); return testCategoryReferenceArrayStaticBean; @@ -158,6 +166,7 @@ private void safeAccessTestPropertyReferenceArrayDynamicBean() { } } + @XmlElement public IBeanList> getTestPropertyReferenceArrayDynamicBean() { safeAccessTestPropertyReferenceArrayDynamicBean(); return testPropertyReferenceArrayDynamicBean; @@ -187,6 +196,7 @@ private void safeAccessTestPropertyReferenceArrayStaticBean() { } } + @XmlElement public IBeanList> getTestPropertyReferenceArrayStaticBean() { safeAccessTestPropertyReferenceArrayStaticBean(); return testPropertyReferenceArrayStaticBean; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCrossLinkedParametersWithCalculation.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCrossLinkedParametersWithCalculation.java index c0182d79ae..89fc80dd64 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCrossLinkedParametersWithCalculation.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestCrossLinkedParametersWithCalculation.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestCrossLinkedParametersWithCalculation extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestCrossLinkedParametersWithCalculation"; @@ -103,6 +109,7 @@ public boolean isSetCalcedTrl() { return calcedTrl.isSet(); } + @XmlElement public BeanPropertyFloat getCalcedTrlBean() { safeAccessCalcedTrl(); return calcedTrl; diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestMassParameters.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestMassParameters.java index 8753c5fa8c..0ea603cc4c 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestMassParameters.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestMassParameters.java @@ -12,15 +12,19 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; -import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ComposedPropertyInstance; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyComposed; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -35,6 +39,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestMassParameters extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestMassParameters"; @@ -82,6 +88,7 @@ private void safeAccessMass() { } } + @XmlElement(nillable = true) public TestParameter getMass() { safeAccessMass(); return mass.getValue(); diff --git a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestParameter.java b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestParameter.java index 3ee5705dde..c2142f749d 100644 --- a/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestParameter.java +++ b/de.dlr.sc.virsat.model.extension.tests/src-gen/de/dlr/sc/virsat/model/extension/tests/model/ATestParameter.java @@ -12,17 +12,21 @@ // ***************************************************************** // * Import Statements // ***************************************************************** -import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; -import org.eclipse.emf.edit.domain.EditingDomain; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; +import javax.xml.bind.annotation.XmlRootElement; +import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; +import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.common.command.Command; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.UnitValuePropertyInstance; import de.dlr.sc.virsat.model.dvlm.categories.CategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; -import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; -import de.dlr.sc.virsat.model.dvlm.categories.Category; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; // ***************************************************************** @@ -37,6 +41,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class ATestParameter extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.tests.TestParameter"; @@ -103,6 +109,7 @@ public boolean isSetDefaultValue() { return defaultValue.isSet(); } + @XmlElement public BeanPropertyFloat getDefaultValueBean() { safeAccessDefaultValue(); return defaultValue; diff --git a/de.dlr.sc.virsat.model.extension.visualisation.feature/feature.xml b/de.dlr.sc.virsat.model.extension.visualisation.feature/feature.xml index 3c8c2df6d1..2ae7dd86f4 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation.feature/feature.xml +++ b/de.dlr.sc.virsat.model.extension.visualisation.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.extension.visualisation.feature/pom.xml b/de.dlr.sc.virsat.model.extension.visualisation.feature/pom.xml index 12a7002468..8e5d77897a 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation.feature/pom.xml +++ b/de.dlr.sc.virsat.model.extension.visualisation.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.extension.visualisation.feature diff --git a/de.dlr.sc.virsat.model.extension.visualisation.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.visualisation.test/META-INF/MANIFEST.MF index 4a3156829f..6a1e8f8c8c 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.visualisation.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Visualization Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.visualisation.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.model.extension.visualisation;bundle-version="0.0.1" Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.model.extension.visualisation.test/pom.xml b/de.dlr.sc.virsat.model.extension.visualisation.test/pom.xml index e55e6aef12..53703349e4 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation.test/pom.xml +++ b/de.dlr.sc.virsat.model.extension.visualisation.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.visualisation.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.visualisation.ui/META-INF/MANIFEST.MF index fc0bc41197..cab6aeea01 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.visualisation.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Visualization UI Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.visualisation.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Require-Bundle: de.dlr.sc.virsat.model.extension.visualisation, org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.visualisation.ui/pom.xml b/de.dlr.sc.virsat.model.extension.visualisation.ui/pom.xml index 823752a3dd..7eb6ad8c4e 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation.ui/pom.xml +++ b/de.dlr.sc.virsat.model.extension.visualisation.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.visualisation/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.extension.visualisation/META-INF/MANIFEST.MF index e5f17901dc..0d2ff6fc84 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.extension.visualisation/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Model Extension Visualization Bundle-SymbolicName: de.dlr.sc.virsat.model.extension.visualisation;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model.extension.visualisation/pom.xml b/de.dlr.sc.virsat.model.extension.visualisation/pom.xml index 045728a208..61d54ba6fe 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation/pom.xml +++ b/de.dlr.sc.virsat.model.extension.visualisation/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.extension.visualisation/src-gen/de/dlr/sc/virsat/model/extension/visualisation/model/AVisualisation.java b/de.dlr.sc.virsat.model.extension.visualisation/src-gen/de/dlr/sc/virsat/model/extension/visualisation/model/AVisualisation.java index 7ae0dab52e..b302ffdb25 100644 --- a/de.dlr.sc.virsat.model.extension.visualisation/src-gen/de/dlr/sc/virsat/model/extension/visualisation/model/AVisualisation.java +++ b/de.dlr.sc.virsat.model.extension.visualisation/src-gen/de/dlr/sc/virsat/model/extension/visualisation/model/AVisualisation.java @@ -12,13 +12,16 @@ // ***************************************************************** // * Import Statements // ***************************************************************** +import javax.xml.bind.annotation.XmlAccessorType; import de.dlr.sc.virsat.model.concept.types.category.IBeanCategoryAssignment; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyEnum; import de.dlr.sc.virsat.model.dvlm.concepts.util.ActiveConceptHelper; import org.eclipse.emf.common.util.URI; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.EnumUnitPropertyInstance; +import javax.xml.bind.annotation.XmlRootElement; import de.dlr.sc.virsat.model.dvlm.categories.util.CategoryInstantiator; import de.dlr.sc.virsat.model.dvlm.categories.Category; +import javax.xml.bind.annotation.XmlAccessType; import de.dlr.sc.virsat.model.dvlm.concepts.Concept; import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ResourcePropertyInstance; import org.eclipse.emf.edit.domain.EditingDomain; @@ -28,6 +31,7 @@ import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyFloat; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyResource; import de.dlr.sc.virsat.model.ext.core.model.GenericCategory; +import javax.xml.bind.annotation.XmlElement; import de.dlr.sc.virsat.model.concept.types.property.BeanPropertyInt; @@ -43,6 +47,8 @@ * * */ +@XmlRootElement +@XmlAccessorType(XmlAccessType.NONE) public abstract class AVisualisation extends GenericCategory implements IBeanCategoryAssignment { public static final String FULL_QUALIFIED_CATEGORY_NAME = "de.dlr.sc.virsat.model.extension.visualisation.Visualisation"; @@ -136,6 +142,7 @@ public double getShapeEnum() { return shape.getEnumValue(); } + @XmlElement public BeanPropertyEnum getShapeBean() { safeAccessShape(); return shape; @@ -167,6 +174,7 @@ public URI getGeometryFile() { return geometryFile.getValue(); } + @XmlElement public BeanPropertyResource getGeometryFileBean() { safeAccessGeometryFile(); return geometryFile; @@ -203,6 +211,7 @@ public boolean isSetRadius() { return radius.isSet(); } + @XmlElement public BeanPropertyFloat getRadiusBean() { safeAccessRadius(); return radius; @@ -239,6 +248,7 @@ public boolean isSetSizeX() { return sizeX.isSet(); } + @XmlElement public BeanPropertyFloat getSizeXBean() { safeAccessSizeX(); return sizeX; @@ -275,6 +285,7 @@ public boolean isSetSizeY() { return sizeY.isSet(); } + @XmlElement public BeanPropertyFloat getSizeYBean() { safeAccessSizeY(); return sizeY; @@ -311,6 +322,7 @@ public boolean isSetSizeZ() { return sizeZ.isSet(); } + @XmlElement public BeanPropertyFloat getSizeZBean() { safeAccessSizeZ(); return sizeZ; @@ -347,6 +359,7 @@ public boolean isSetColor() { return color.isSet(); } + @XmlElement public BeanPropertyInt getColorBean() { safeAccessColor(); return color; @@ -383,6 +396,7 @@ public boolean isSetTransparency() { return transparency.isSet(); } + @XmlElement public BeanPropertyFloat getTransparencyBean() { safeAccessTransparency(); return transparency; @@ -419,6 +433,7 @@ public boolean isSetPositionX() { return positionX.isSet(); } + @XmlElement public BeanPropertyFloat getPositionXBean() { safeAccessPositionX(); return positionX; @@ -455,6 +470,7 @@ public boolean isSetPositionY() { return positionY.isSet(); } + @XmlElement public BeanPropertyFloat getPositionYBean() { safeAccessPositionY(); return positionY; @@ -491,6 +507,7 @@ public boolean isSetPositionZ() { return positionZ.isSet(); } + @XmlElement public BeanPropertyFloat getPositionZBean() { safeAccessPositionZ(); return positionZ; @@ -527,6 +544,7 @@ public boolean isSetRotationX() { return rotationX.isSet(); } + @XmlElement public BeanPropertyFloat getRotationXBean() { safeAccessRotationX(); return rotationX; @@ -563,6 +581,7 @@ public boolean isSetRotationY() { return rotationY.isSet(); } + @XmlElement public BeanPropertyFloat getRotationYBean() { safeAccessRotationY(); return rotationY; @@ -599,6 +618,7 @@ public boolean isSetRotationZ() { return rotationZ.isSet(); } + @XmlElement public BeanPropertyFloat getRotationZBean() { safeAccessRotationZ(); return rotationZ; diff --git a/de.dlr.sc.virsat.model.external.tests.edit/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.external.tests.edit/META-INF/MANIFEST.MF index 3c2ae2eb17..b06ff4cb9b 100644 --- a/de.dlr.sc.virsat.model.external.tests.edit/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.external.tests.edit/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model.external.tests.edit;singleton:=true Automatic-Module-Name: de.dlr.sc.virsat.model.external.tests.edit -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Activator: de.dlr.sc.virsat.model.external.tests.provider.ExternalModelEditPlugin$Implementation Bundle-Vendor: %providerName diff --git a/de.dlr.sc.virsat.model.external.tests.edit/about.html b/de.dlr.sc.virsat.model.external.tests.edit/about.html new file mode 100644 index 0000000000..39cd6411ff --- /dev/null +++ b/de.dlr.sc.virsat.model.external.tests.edit/about.html @@ -0,0 +1,27 @@ + + + + +About + + +

About This Content

+ +

December 18, 2018

+

License

+ +

The German Aerospace Center (DLR) makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at https://www.eclipse.org/legal/epl-2.0. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from German Aerospace Center (DLR), the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to this content.

+ + + diff --git a/de.dlr.sc.virsat.model.external.tests.edit/build.properties b/de.dlr.sc.virsat.model.external.tests.edit/build.properties index 71801a53c5..9c5ba5157d 100644 --- a/de.dlr.sc.virsat.model.external.tests.edit/build.properties +++ b/de.dlr.sc.virsat.model.external.tests.edit/build.properties @@ -4,7 +4,8 @@ bin.includes = .,\ icons/,\ META-INF/,\ plugin.xml,\ - plugin.properties + plugin.properties,\ + about.html jars.compile.order = . source.. = src-gen/ output.. = target/classes/ diff --git a/de.dlr.sc.virsat.model.external.tests.edit/pom.xml b/de.dlr.sc.virsat.model.external.tests.edit/pom.xml index 2d83453dfa..28099cc734 100644 --- a/de.dlr.sc.virsat.model.external.tests.edit/pom.xml +++ b/de.dlr.sc.virsat.model.external.tests.edit/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.external.tests/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.external.tests/META-INF/MANIFEST.MF index a1d09f6fc2..e4a6e3c70a 100644 --- a/de.dlr.sc.virsat.model.external.tests/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.external.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model.external.tests;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Automatic-Module-Name: de.dlr.sc.virsat.model.external.tests Bundle-RequiredExecutionEnvironment: JavaSE-1.8 diff --git a/de.dlr.sc.virsat.model.external.tests/about.html b/de.dlr.sc.virsat.model.external.tests/about.html new file mode 100644 index 0000000000..39cd6411ff --- /dev/null +++ b/de.dlr.sc.virsat.model.external.tests/about.html @@ -0,0 +1,27 @@ + + + + +About + + +

About This Content

+ +

December 18, 2018

+

License

+ +

The German Aerospace Center (DLR) makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at https://www.eclipse.org/legal/epl-2.0. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from German Aerospace Center (DLR), the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to this content.

+ + + diff --git a/de.dlr.sc.virsat.model.external.tests/build.properties b/de.dlr.sc.virsat.model.external.tests/build.properties index 8e34d94636..6510888feb 100644 --- a/de.dlr.sc.virsat.model.external.tests/build.properties +++ b/de.dlr.sc.virsat.model.external.tests/build.properties @@ -7,4 +7,5 @@ bin.includes = META-INF/,\ plugin.xml,\ plugin.properties,\ model/,\ - instance/ + instance/,\ + about.html diff --git a/de.dlr.sc.virsat.model.external.tests/pom.xml b/de.dlr.sc.virsat.model.external.tests/pom.xml index 24a795d934..27deec2b8f 100644 --- a/de.dlr.sc.virsat.model.external.tests/pom.xml +++ b/de.dlr.sc.virsat.model.external.tests/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.feature/aggregatePom/pom.xml b/de.dlr.sc.virsat.model.feature/aggregatePom/pom.xml index 087ffbf63a..1a362d6cd7 100644 --- a/de.dlr.sc.virsat.model.feature/aggregatePom/pom.xml +++ b/de.dlr.sc.virsat.model.feature/aggregatePom/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 4.0.0 de.dlr.sc.virsat.model de.dlr.sc.virsat.model.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT pom de.dlr.sc.virsat.model.parent @@ -21,7 +21,7 @@ SPDX-License-Identifier: EPL-2.0 ../../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT diff --git a/de.dlr.sc.virsat.model.feature/feature.xml b/de.dlr.sc.virsat.model.feature/feature.xml index aa51da95de..55ba520c27 100644 --- a/de.dlr.sc.virsat.model.feature/feature.xml +++ b/de.dlr.sc.virsat.model.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.model.feature/pom.xml b/de.dlr.sc.virsat.model.feature/pom.xml index b029a6bb29..f2fa76ba88 100644 --- a/de.dlr.sc.virsat.model.feature/pom.xml +++ b/de.dlr.sc.virsat.model.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.model.feature diff --git a/de.dlr.sc.virsat.model.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.test/META-INF/MANIFEST.MF index ed9e7e690f..40e16f5816 100644 --- a/de.dlr.sc.virsat.model.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Data Model Tests Bundle-SymbolicName: de.dlr.sc.virsat.model.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Vendor: DLR (German Aerospace Center) Fragment-Host: de.dlr.sc.virsat.model diff --git a/de.dlr.sc.virsat.model.test/pom.xml b/de.dlr.sc.virsat.model.test/pom.xml index f838ab7270..8423b75cfb 100644 --- a/de.dlr.sc.virsat.model.test/pom.xml +++ b/de.dlr.sc.virsat.model.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model.test/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelperTest.java b/de.dlr.sc.virsat.model.test/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelperTest.java index b3e97fca07..dcc01570a4 100644 --- a/de.dlr.sc.virsat.model.test/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelperTest.java +++ b/de.dlr.sc.virsat.model.test/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelperTest.java @@ -234,8 +234,11 @@ public void qudvImportExportTest() throws IOException { assertEquals(sou1.getUuid(), importedSoU.getUuid()); assertEquals(sou1.getName(), importedSoU.getName()); - assertEquals(3, importedSoU.getUnit().size()); - assertEquals(44, importedSoU.getSystemOfQuantities().get(0).getQuantityKind().size()); + int EXPECTED_UNITS = sou1.getUnit().size(); + int EXPECTED_QUANTITY_KINDS = sou1.getSystemOfQuantities().get(0).getQuantityKind().size(); + + assertEquals(EXPECTED_UNITS, importedSoU.getUnit().size()); + assertEquals(EXPECTED_QUANTITY_KINDS, importedSoU.getSystemOfQuantities().get(0).getQuantityKind().size()); //without the copySystemOfUnits method the Ids of the imported Qudv model are the same assertEquals(simpleUnit.getUuid(), importedSoU.getUnit().get(0).getUuid()); @@ -349,79 +352,50 @@ public void copySystemOfUnitsTest() { sou1.getUnit().add(m); sou1.getUnit().add(kg); - //we directly copy the systemOfUnits - SystemOfUnits sou2 = sou1; + //now use the ecore.uitl copier to do the copy + SystemOfUnits sou2 = qudvHelper.copySystemOfUnits(sou1); - //the systemOfUnits were directly copied, everything should be the same, also the IDs - assertEquals(sou1.getUuid(), sou2.getUuid()); + //ids should not be the same + assertNotSame(sou1.getUuid(), sou2.getUuid()); assertEquals(sou1.getName(), sou2.getName()); - //check that three units are there, one systemOfQuantities and eight quantityKinds are there - assertEquals(3, sou1.getUnit().size()); - assertEquals(1, sou1.getSystemOfQuantities().size()); - assertEquals(44, sou1.getSystemOfQuantities().get(0).getQuantityKind().size()); - assertEquals(3, sou2.getUnit().size()); - assertEquals(1, sou2.getSystemOfQuantities().size()); - assertEquals(44, sou2.getSystemOfQuantities().get(0).getQuantityKind().size()); + //check that the amounts of units, one systemOfQunatities, and quantityKinds match + int EXPECTED_NUMBER_SYSTEM_OF_Quantities = 1; + int EXPECTER_NUMBER_UNITS = 3; + int EXPECTED_NUMBER_QUANTITY_KINDS = sou1.getSystemOfQuantities().get(0).getQuantityKind().size(); - //without the copySystemOfUnits method the Ids of the three units are the same - assertEquals(sou1.getUnit().get(0).getUuid(), sou2.getUnit().get(0).getUuid()); + assertEquals(EXPECTER_NUMBER_UNITS, sou2.getUnit().size()); + assertEquals(EXPECTED_NUMBER_SYSTEM_OF_Quantities, sou2.getSystemOfQuantities().size()); + assertEquals(EXPECTED_NUMBER_QUANTITY_KINDS, sou2.getSystemOfQuantities().get(0).getQuantityKind().size()); + + //after using the copyUnitManagement method the Ids of the three units not the same anymore + assertNotSame(sou1.getUnit().get(0).getUuid(), sou2.getUnit().get(0).getUuid()); assertEquals(sou1.getUnit().get(0).getName(), sou2.getUnit().get(0).getName()); - assertEquals(sou1.getUnit().get(1).getUuid(), sou2.getUnit().get(1).getUuid()); + assertNotSame(sou1.getUnit().get(1).getUuid(), sou2.getUnit().get(1).getUuid()); assertEquals(sou1.getUnit().get(1).getName(), sou2.getUnit().get(1).getName()); - assertEquals(sou1.getUnit().get(2).getUuid(), sou2.getUnit().get(2).getUuid()); + assertNotSame(sou1.getUnit().get(2).getUuid(), sou2.getUnit().get(2).getUuid()); assertEquals(sou1.getUnit().get(2).getName(), sou2.getUnit().get(2).getName()); - + //same with the systemOfQuantities - assertEquals(sou1.getSystemOfQuantities().get(0).getUuid(), sou2.getSystemOfQuantities().get(0).getUuid()); + assertNotSame(sou1.getSystemOfQuantities().get(0).getUuid(), sou2.getSystemOfQuantities().get(0).getUuid()); assertEquals(sou1.getSystemOfQuantities().get(0).getName(), sou2.getSystemOfQuantities().get(0).getName()); - //same with the eight quantityKinds - assertEquals(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(0).getUuid(), sou2.getSystemOfQuantities().get(0).getQuantityKind().get(0).getUuid()); + //same with the two quantityKinds + assertNotSame(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(0).getUuid(), sou2.getSystemOfQuantities().get(0).getQuantityKind().get(0).getUuid()); assertEquals(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(0).getName(), sou2.getSystemOfQuantities().get(0).getQuantityKind().get(0).getName()); - assertEquals(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(1).getUuid(), sou2.getSystemOfQuantities().get(0).getQuantityKind().get(1).getUuid()); + assertNotSame(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(1).getUuid(), sou2.getSystemOfQuantities().get(0).getQuantityKind().get(1).getUuid()); assertEquals(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(1).getName(), sou2.getSystemOfQuantities().get(0).getQuantityKind().get(1).getName()); - - //now use the ecore.uitl copier to do the copy - SystemOfUnits sou3 = qudvHelper.copySystemOfUnits(sou1); - - //ids should not be the same - assertNotSame(sou1.getUuid(), sou3.getUuid()); - assertEquals(sou1.getName(), sou3.getName()); - - //check that three units are there, one systemOfQunatities and eight quantityKinds are there - assertEquals(3, sou3.getUnit().size()); - assertEquals(1, sou3.getSystemOfQuantities().size()); - assertEquals(44, sou3.getSystemOfQuantities().get(0).getQuantityKind().size()); - - //after using the copyUnitManagement method the Ids of the three units not the same anymore - assertNotSame(sou1.getUnit().get(0).getUuid(), sou3.getUnit().get(0).getUuid()); - assertEquals(sou1.getUnit().get(0).getName(), sou3.getUnit().get(0).getName()); - assertNotSame(sou1.getUnit().get(1).getUuid(), sou3.getUnit().get(1).getUuid()); - assertEquals(sou1.getUnit().get(1).getName(), sou3.getUnit().get(1).getName()); - assertNotSame(sou1.getUnit().get(2).getUuid(), sou3.getUnit().get(2).getUuid()); - assertEquals(sou1.getUnit().get(2).getName(), sou3.getUnit().get(2).getName()); - - //same with the systemOfQuantities - assertNotSame(sou1.getSystemOfQuantities().get(0).getUuid(), sou3.getSystemOfQuantities().get(0).getUuid()); - assertEquals(sou1.getSystemOfQuantities().get(0).getName(), sou3.getSystemOfQuantities().get(0).getName()); - - //same with the two quantityKinds - assertNotSame(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(0).getUuid(), sou3.getSystemOfQuantities().get(0).getQuantityKind().get(0).getUuid()); - assertEquals(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(0).getName(), sou3.getSystemOfQuantities().get(0).getQuantityKind().get(0).getName()); - assertNotSame(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(1).getUuid(), sou3.getSystemOfQuantities().get(0).getQuantityKind().get(1).getUuid()); - assertEquals(sou1.getSystemOfQuantities().get(0).getQuantityKind().get(1).getName(), sou3.getSystemOfQuantities().get(0).getQuantityKind().get(1).getName()); //Last but not least we check for the references //in the test data we had kg referencing to g (prefixed unit) //retrieve the third unit, which was kg and cast it to PrefixedUnit, so we can actually do what we want to do - PrefixedUnit prefixedUnit = (PrefixedUnit) sou3.getUnit().get(2); + PrefixedUnit prefixedUnit = (PrefixedUnit) sou2.getUnit().get(2); //and check that the reference is not null assertNotNull(prefixedUnit.getReferenceUnit()); //then we check if the reference is pointing to the correct unit, by checking the id and the name - assertEquals(prefixedUnit.getReferenceUnit().getUuid(), sou3.getUnit().get(0).getUuid()); - assertEquals(prefixedUnit.getReferenceUnit().getName(), sou3.getUnit().get(0).getName()); + assertEquals(prefixedUnit.getReferenceUnit().getUuid(), sou2.getUnit().get(0).getUuid()); + assertEquals(prefixedUnit.getReferenceUnit().getName(), sou2.getUnit().get(0).getName()); } diff --git a/de.dlr.sc.virsat.model.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model.ui/META-INF/MANIFEST.MF index b4a7a6302f..aa44df702e 100644 --- a/de.dlr.sc.virsat.model.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Data Model UI Bundle-SymbolicName: de.dlr.sc.virsat.model.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.model.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.model.edit;visibility:=reexport, diff --git a/de.dlr.sc.virsat.model.ui/pom.xml b/de.dlr.sc.virsat.model.ui/pom.xml index 566a5cb79d..249bbbab31 100644 --- a/de.dlr.sc.virsat.model.ui/pom.xml +++ b/de.dlr.sc.virsat.model.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.model/META-INF/MANIFEST.MF index e4032ab1c2..45503ecb30 100644 --- a/de.dlr.sc.virsat.model/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.model/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: de.dlr.sc.virsat.model;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Require-Bundle: de.dlr.sc.virsat.external.lib.commons.cli, org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.model/pom.xml b/de.dlr.sc.virsat.model/pom.xml index 0b914e3d15..b69b169e41 100644 --- a/de.dlr.sc.virsat.model/pom.xml +++ b/de.dlr.sc.virsat.model/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.model/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelper.java b/de.dlr.sc.virsat.model/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelper.java index 6820277424..f1425c6f00 100644 --- a/de.dlr.sc.virsat.model/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelper.java +++ b/de.dlr.sc.virsat.model/src/de/dlr/sc/virsat/model/dvlm/qudv/util/QudvUnitHelper.java @@ -721,15 +721,43 @@ private void createLibraryOfUnitsAndQuantityKinds(SystemOfUnits systemOfUnits) { factorMap.put(length, 2.0); factorMap.put(time, M2); factorMap.put(temperature, M1); - systemOfQuantities.getQuantityKind().add(createAndAddDerivedQuantityKind("Specific Heat Capacity", "L² T⁻² Θ⁻¹", "specificHeatCapacityQK", "", factorMap)); - + DerivedQuantityKind specificHeatCapacity = createAndAddDerivedQuantityKind("Specific Heat Capacity", "L² T⁻² Θ⁻¹", "specificHeatCapacityQK", "", factorMap); + systemOfQuantities.getQuantityKind().add(specificHeatCapacity); + //thermal conductivity factorMap.clear(); factorMap.put(length, 1.0); factorMap.put(mass, 1.0); factorMap.put(time, M3); factorMap.put(temperature, M1); - systemOfQuantities.getQuantityKind().add(createAndAddDerivedQuantityKind("Thermal Conductivity", "L¹ M¹ T⁻³ Θ⁻¹", "thermalConductivityQK", "", factorMap)); + DerivedQuantityKind thermalConductivity = createAndAddDerivedQuantityKind("Thermal Conductivity", "L¹ M¹ T⁻³ Θ⁻¹", "thermalConductivityQK", "", factorMap); + systemOfQuantities.getQuantityKind().add(thermalConductivity); + + //thermal contact resistance + factorMap.clear(); + factorMap.put(length, M2); + factorMap.put(mass, M1); + factorMap.put(time, 3.0); + factorMap.put(temperature, 1.0); + DerivedQuantityKind thermalContactResistance = createAndAddDerivedQuantityKind("Thermal Contact Resistance", "L⁻² M⁻¹ T³ Θ¹", "thermalContactResistanceQK", "", factorMap); + systemOfQuantities.getQuantityKind().add(thermalContactResistance); + + //thermal contact conductance + factorMap.clear(); + factorMap.put(length, 2.0); + factorMap.put(mass, 1.0); + factorMap.put(time, M3); + factorMap.put(temperature, M1); + DerivedQuantityKind thermalContactConductance = createAndAddDerivedQuantityKind("Thermal Contact Conductance", "L² M¹ T⁻³ Θ⁻¹", "thermalContactConductanceQK", "", factorMap); + systemOfQuantities.getQuantityKind().add(thermalContactConductance); + + //thermal contact conductance per unit area + factorMap.clear(); + factorMap.put(mass, 1.0); + factorMap.put(time, M3); + factorMap.put(temperature, M1); + DerivedQuantityKind thermalContactConductancePerUnitArea = createAndAddDerivedQuantityKind("Thermal Contact Conductance Per Unit Area", "M¹ T⁻³ Θ⁻¹", "thermalContactConductancePerUnitAreaQK", "", factorMap); + systemOfQuantities.getQuantityKind().add(thermalContactConductancePerUnitArea); //time squared factorMap.clear(); @@ -980,13 +1008,55 @@ private void createLibraryOfUnitsAndQuantityKinds(SystemOfUnits systemOfUnits) { DerivedUnit megabytePerSecond = createAndAddDerivedUnit("Megabyte Per Second", "MB s⁻¹", "megabyterPerSecondUnit", "", dataRateQK, unitFactorMap); systemOfUnits.getUnit().add(megabytePerSecond); - //Ampere hrs as electric charge unitFactorMap.clear(); unitFactorMap.put(hour, 1.0); unitFactorMap.put(ampere, 1.0); DerivedUnit ampereHours = createAndAddDerivedUnit("Ampere hours", "Ah", "ampereHoursUnit", "", electricChargeQK, unitFactorMap); systemOfUnits.getUnit().add(ampereHours); + + //specific heat capacity: meter squared per second squared per kelvin + unitFactorMap.clear(); + unitFactorMap.put(meter, 2.0); + unitFactorMap.put(second, M2); + unitFactorMap.put(kelvin, M1); + DerivedUnit meterSquaredPerSecondSquaredPerKelvin = createAndAddDerivedUnit("Meter Squared Per Second Squared Per Kelvin", "m² s⁻² K⁻¹", "meterSquaredPerSecondSquaredPerKelvinUnit", "", specificHeatCapacity, unitFactorMap); + systemOfUnits.getUnit().add(meterSquaredPerSecondSquaredPerKelvin); + + //thermal conductivity: meter kilogram per second cubed per kelvin + unitFactorMap.clear(); + unitFactorMap.put(meter, 1.0); + unitFactorMap.put(kilogram, 1.0); + unitFactorMap.put(second, M3); + unitFactorMap.put(kelvin, M1); + DerivedUnit meterKilogramPerSecondCubedPerKelvin = createAndAddDerivedUnit("Meter Kilogram Per Second Cubed Per Kelvin", "m kg s⁻³ K⁻¹", "meterKilogramPerSecondCubedPerKelvinUnit", "", thermalConductivity, unitFactorMap); + systemOfUnits.getUnit().add(meterKilogramPerSecondCubedPerKelvin); + + //thermal contact resistance: second cubed kelvin per meter squared per kilogram + unitFactorMap.clear(); + unitFactorMap.put(meter, M2); + unitFactorMap.put(kilogram, M1); + unitFactorMap.put(second, 3.0); + unitFactorMap.put(kelvin, 1.0); + DerivedUnit secondCubedKelvinPerMeterSquaredPerKilogram = createAndAddDerivedUnit("Second Cubed Kelvin Per Meter Squared Per Kilogram", "s³ K m⁻² kg⁻¹", "secondCubedKelvinPerMeterSquaredPerKilogramUnit", "", thermalContactResistance, unitFactorMap); + systemOfUnits.getUnit().add(secondCubedKelvinPerMeterSquaredPerKilogram); + + //thermal contact resistance: meter squared kilogram per second cubed per kelvin + unitFactorMap.clear(); + unitFactorMap.put(meter, 2.0); + unitFactorMap.put(kilogram, 1.0); + unitFactorMap.put(second, M3); + unitFactorMap.put(kelvin, M1); + DerivedUnit meterSquaredKilogramPerSecondCubedPerKelvin = createAndAddDerivedUnit("MeterSquaredKilogramPerSecondCubedPerKelvin", "m² kg¹ s⁻³ K⁻¹", "meterSquaredKilogramPerSecondCubedPerKelvinUnit", "", thermalContactConductance, unitFactorMap); + systemOfUnits.getUnit().add(meterSquaredKilogramPerSecondCubedPerKelvin); + + //thermal contact conductance per unit area: second cubed kelvin per meter squared per kilogram + unitFactorMap.clear(); + unitFactorMap.put(kilogram, 1.0); + unitFactorMap.put(second, M3); + unitFactorMap.put(kelvin, M1); + DerivedUnit kilogramPerSecondCubedPerKelvin = createAndAddDerivedUnit("Kilogram Per Second Cubed Per Kelvin", "kg s⁻³ K⁻¹", "meterSquaredPerSecondSquaredPerKelvinUnit", "", thermalContactConductancePerUnitArea, unitFactorMap); + systemOfUnits.getUnit().add(kilogramPerSecondCubedPerKelvin); } public static final String UNIT_NAME_DEGREE = "Degree"; @@ -1294,17 +1364,10 @@ protected EObject createCopy(EObject object) { @Override protected void copyAttribute(EAttribute attribute, EObject object, EObject copyEObject) { - // holy quakomolee // We do not copy the attribute ID because it has been already updated // IDs have to be unique !!! if (attribute == GeneralPackage.Literals.IUUID__UUID) { return; - // } else if (attribute == QudvPackage.Literals.AUNIT__ID) { - // return; - // } else if (attribute == QudvPackage.Literals.AQUANTITY_KIND__ID) { - // return; - // } else if (attribute == QudvPackage.Literals.SYSTEM_OF_QUANTITIES__ID) { - // return; } super.copyAttribute(attribute, object, copyEObject); } diff --git a/de.dlr.sc.virsat.p2updatesite/category.xml b/de.dlr.sc.virsat.p2updatesite/category.xml index d1446c568a..cbffd5ea8b 100644 --- a/de.dlr.sc.virsat.p2updatesite/category.xml +++ b/de.dlr.sc.virsat.p2updatesite/category.xml @@ -1,84 +1,84 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/de.dlr.sc.virsat.p2updatesite/pom.xml b/de.dlr.sc.virsat.p2updatesite/pom.xml index a125e2e47e..195f1db816 100644 --- a/de.dlr.sc.virsat.p2updatesite/pom.xml +++ b/de.dlr.sc.virsat.p2updatesite/pom.xml @@ -15,7 +15,7 @@ ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.p2updatesite diff --git a/de.dlr.sc.virsat.performance.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.performance.test/META-INF/MANIFEST.MF index 386d44be62..a293a3f4f9 100644 --- a/de.dlr.sc.virsat.performance.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.performance.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Performance Tests Bundle-SymbolicName: de.dlr.sc.virsat.performance.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.junit, diff --git a/de.dlr.sc.virsat.performance.test/pom.xml b/de.dlr.sc.virsat.performance.test/pom.xml index e3ec227ff2..0adb2e98ea 100644 --- a/de.dlr.sc.virsat.performance.test/pom.xml +++ b/de.dlr.sc.virsat.performance.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.product/pom.xml b/de.dlr.sc.virsat.product/pom.xml index c5530a8475..7d5ccbd0a7 100644 --- a/de.dlr.sc.virsat.product/pom.xml +++ b/de.dlr.sc.virsat.product/pom.xml @@ -15,7 +15,7 @@ ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.product @@ -49,9 +49,9 @@ - ../de.dlr.sc.virsat.target/virsat.target + ../de.dlr.sc.virsat.target/virsat_windows.target target - virsat + virsat_windows diff --git a/de.dlr.sc.virsat.product/virsat_core.product b/de.dlr.sc.virsat.product/virsat_core.product index 7e7c5afee8..3db9aa4da9 100644 --- a/de.dlr.sc.virsat.product/virsat_core.product +++ b/de.dlr.sc.virsat.product/virsat_core.product @@ -1,14 +1,14 @@ - + Virtual Satellite 4 - DVLM Core -Version 4.12.0 +Version 4.12.1 © Copyright by DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e. V., German Aerospace Center) 2020. diff --git a/de.dlr.sc.virsat.product/virsat_server.product b/de.dlr.sc.virsat.product/virsat_server.product index 0fa3b71a3a..f7cfa04848 100644 --- a/de.dlr.sc.virsat.product/virsat_server.product +++ b/de.dlr.sc.virsat.product/virsat_server.product @@ -1,7 +1,7 @@ - + diff --git a/de.dlr.sc.virsat.project.feature/feature.xml b/de.dlr.sc.virsat.project.feature/feature.xml index eb5ed392bc..0920fb67fb 100644 --- a/de.dlr.sc.virsat.project.feature/feature.xml +++ b/de.dlr.sc.virsat.project.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.project.feature/pom.xml b/de.dlr.sc.virsat.project.feature/pom.xml index 7c08b01faa..b5584eacf0 100644 --- a/de.dlr.sc.virsat.project.feature/pom.xml +++ b/de.dlr.sc.virsat.project.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.project.feature diff --git a/de.dlr.sc.virsat.project.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.project.test/META-INF/MANIFEST.MF index 919f5741a2..e064ad35af 100644 --- a/de.dlr.sc.virsat.project.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.project.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Project Resources Test Bundle-SymbolicName: de.dlr.sc.virsat.project.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.project Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.project.test/pom.xml b/de.dlr.sc.virsat.project.test/pom.xml index f3a9fb8ae8..5f3bdd4b40 100644 --- a/de.dlr.sc.virsat.project.test/pom.xml +++ b/de.dlr.sc.virsat.project.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.project.test/src/de/dlr/sc/virsat/project/test/AProjectTestCase.java b/de.dlr.sc.virsat.project.test/src/de/dlr/sc/virsat/project/test/AProjectTestCase.java index 3727575f89..81cec39fc1 100644 --- a/de.dlr.sc.virsat.project.test/src/de/dlr/sc/virsat/project/test/AProjectTestCase.java +++ b/de.dlr.sc.virsat.project.test/src/de/dlr/sc/virsat/project/test/AProjectTestCase.java @@ -26,7 +26,10 @@ import org.junit.After; import org.junit.Before; import org.junit.Rule; +import org.junit.rules.DisableOnDebug; import org.junit.rules.TestName; +import org.junit.rules.TestRule; +import org.junit.rules.Timeout; import de.dlr.sc.virsat.model.dvlm.Repository; import de.dlr.sc.virsat.model.dvlm.roles.IUserContext; @@ -46,8 +49,8 @@ public abstract class AProjectTestCase { protected static final int MAX_TEST_CASE_TIMEOUT_SECONDS = 30; protected static final int MAX_TEST_CASE_WAIT_TIME_MILLI_SECONDS = 1000; - //@Rule - //public TestRule globalTimeout = new DisableOnDebug(Timeout.seconds(MAX_TEST_CASE_TIMEOUT_SECONDS)); + @Rule + public TestRule globalTimeout = new DisableOnDebug(Timeout.seconds(MAX_TEST_CASE_TIMEOUT_SECONDS)); protected static final String TEST_PROJECT_NAME = "testProject"; private static final String JUNIT_DEBUG_PROJECT_TEST_CASE = "JUNIT_DEBUG_PROJECT_TEST_CASE"; diff --git a/de.dlr.sc.virsat.project.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.project.ui/META-INF/MANIFEST.MF index f654c97a7c..528691a277 100644 --- a/de.dlr.sc.virsat.project.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.project.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Project Resources UI Bundle-SymbolicName: de.dlr.sc.virsat.project.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.project.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Bundle-Localization: plugin diff --git a/de.dlr.sc.virsat.project.ui/plugin.xml b/de.dlr.sc.virsat.project.ui/plugin.xml index 7bfb7db6d7..deee7cb0d5 100644 --- a/de.dlr.sc.virsat.project.ui/plugin.xml +++ b/de.dlr.sc.virsat.project.ui/plugin.xml @@ -336,6 +336,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -454,6 +500,52 @@ tooltip="Redo"> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/de.dlr.sc.virsat.project.ui/pom.xml b/de.dlr.sc.virsat.project.ui/pom.xml index fa92956314..d566a4c675 100644 --- a/de.dlr.sc.virsat.project.ui/pom.xml +++ b/de.dlr.sc.virsat.project.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/VirSatNavigator.java b/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/VirSatNavigator.java index 9b7792c95b..ccdce15f99 100644 --- a/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/VirSatNavigator.java +++ b/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/VirSatNavigator.java @@ -304,6 +304,7 @@ public void drop(DropTargetEvent event) { IStatus status = paletteObjectDropAdapterAssistant.validateDrop(target, DND.DROP_MOVE); if (status.equals(Status.OK_STATUS)) { paletteObjectDropAdapterAssistant.handleDrop(event, target); + expandToLevel(target, 1); } else { listener.drop(event); } diff --git a/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/handler/ChangeValueHandler.java b/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/handler/ChangeValueHandler.java new file mode 100644 index 0000000000..58f05066ff --- /dev/null +++ b/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/handler/ChangeValueHandler.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package de.dlr.sc.virsat.project.ui.navigator.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.edit.command.SetCommand; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.jface.window.Window; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; + +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.PropertyinstancesPackage; +import de.dlr.sc.virsat.model.dvlm.categories.propertyinstances.ValuePropertyInstance; + +/** + * Handler for changing the value of an element from the navigator tree + * + */ +public class ChangeValueHandler extends AEMFCommandCommandHandler { + + public static final String SET_VALUE_DIALOG_TITLE = "Change Value"; + public static final String SET_VALUE_DIALOG_MSG = "New value:"; + + protected String newValue; + + protected String getCurrentValue() { + ValuePropertyInstance vpi = (ValuePropertyInstance) firstSelectedEObject; + return vpi.getValue(); + } + + @Override + public void execute() { + String currentValue = getCurrentValue(); + newValue = showChangeValueDialog(currentValue); + if (newValue != null && !newValue.equals(currentValue)) { + super.execute(); + } + } + + @Override + protected Command createCommand() { + if (firstSelectedEObject instanceof ValuePropertyInstance) { + return SetCommand.create(ed, firstSelectedEObject, PropertyinstancesPackage.Literals.VALUE_PROPERTY_INSTANCE__VALUE, newValue); + } + + return UnexecutableCommand.INSTANCE; + } + + @Override + public boolean isEnabled() { + // Use some dummy value to check for executability of command + newValue = ""; + return super.isEnabled(); + } + + /** + * Show dialog asking user for a string input. + * @param dialogTitle Dialog title + * @param dialogMessage Message + * @param initialValue Initial value that is printed in the field. + * @return New string that user has given + */ + public String showStringInputDialog(String dialogTitle, String dialogMessage, String initialValue) { + Shell shell = Display.getCurrent().getActiveShell(); + InputDialog inputDialog = new InputDialog(shell, dialogTitle, dialogMessage, initialValue, null); + int retDialog = inputDialog.open(); + if (retDialog == Window.OK) { + return inputDialog.getValue(); + } + + return null; + } + + /** + * Show dialog asking user for a name. + * @param initialValue Initial value to print in the field, e.g. current name + * @return Given name. + */ + public String showChangeValueDialog(String initialValue) { + return showStringInputDialog(SET_VALUE_DIALOG_TITLE, SET_VALUE_DIALOG_MSG, initialValue); + } +} diff --git a/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/handler/RenameHandler.java b/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/handler/RenameHandler.java new file mode 100644 index 0000000000..90a0fdeece --- /dev/null +++ b/de.dlr.sc.virsat.project.ui/src/de/dlr/sc/virsat/project/ui/navigator/handler/RenameHandler.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ + +package de.dlr.sc.virsat.project.ui.navigator.handler; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; +import org.eclipse.emf.edit.command.SetCommand; + +import de.dlr.sc.virsat.model.dvlm.general.GeneralPackage; +import de.dlr.sc.virsat.model.dvlm.general.IName; + +/** + * Handler for Renaming an element from the navigator tree + * + */ +public class RenameHandler extends ChangeValueHandler { + + public static final String SET_NAME_DIALOG_TITLE = "Rename Element"; + public static final String SET_NAME_DIALOG_MSG = "New name:"; + + @Override + protected String getCurrentValue() { + IName namedObject = (IName) firstSelectedEObject; + return namedObject.getName(); + } + + @Override + protected Command createCommand() { + if (firstSelectedEObject instanceof IName) { + return SetCommand.create(ed, firstSelectedEObject, GeneralPackage.Literals.INAME__NAME, newValue); + } + + return UnexecutableCommand.INSTANCE; + } + + @Override + public String showChangeValueDialog(String initialValue) { + return showStringInputDialog(SET_NAME_DIALOG_TITLE, SET_NAME_DIALOG_MSG, initialValue); + } +} diff --git a/de.dlr.sc.virsat.project/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.project/META-INF/MANIFEST.MF index 06724fce12..4a17ca70fc 100644 --- a/de.dlr.sc.virsat.project/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.project/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Project Resources Bundle-SymbolicName: de.dlr.sc.virsat.project;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.project.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: de.dlr.sc.virsat.model, diff --git a/de.dlr.sc.virsat.project/pom.xml b/de.dlr.sc.virsat.project/pom.xml index 3ee03c5890..5dd7628c8f 100644 --- a/de.dlr.sc.virsat.project/pom.xml +++ b/de.dlr.sc.virsat.project/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.qudv.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.qudv.ui/META-INF/MANIFEST.MF index e16126932a..c064a1b820 100644 --- a/de.dlr.sc.virsat.qudv.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.qudv.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core QUDV UI Bundle-SymbolicName: de.dlr.sc.virsat.qudv.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Require-Bundle: org.eclipse.osgi, diff --git a/de.dlr.sc.virsat.qudv.ui/pom.xml b/de.dlr.sc.virsat.qudv.ui/pom.xml index 2091f9d544..a830e8c657 100644 --- a/de.dlr.sc.virsat.qudv.ui/pom.xml +++ b/de.dlr.sc.virsat.qudv.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.server.feature/feature.xml b/de.dlr.sc.virsat.server.feature/feature.xml index d46d82bb48..d4f5ddcb6e 100644 --- a/de.dlr.sc.virsat.server.feature/feature.xml +++ b/de.dlr.sc.virsat.server.feature/feature.xml @@ -2,7 +2,7 @@ @@ -31,7 +31,7 @@ by German Aerospace Center (DLR e.V.) - + diff --git a/de.dlr.sc.virsat.server.feature/pom.xml b/de.dlr.sc.virsat.server.feature/pom.xml index 66498d8a6c..5e8375003d 100644 --- a/de.dlr.sc.virsat.server.feature/pom.xml +++ b/de.dlr.sc.virsat.server.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.server.feature diff --git a/de.dlr.sc.virsat.server.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.server.test/META-INF/MANIFEST.MF index ee4c8a9be2..1b368f7553 100644 --- a/de.dlr.sc.virsat.server.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.server.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Headless Rest Jetty Server Tests Bundle-SymbolicName: de.dlr.sc.virsat.server.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.server;bundle-version="0.0.1" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) @@ -10,7 +10,8 @@ Require-Bundle: de.dlr.sc.virsat.team, org.junit, org.eclipse.egit.core, org.hamcrest.library, - org.eclipse.team.svn.core + org.eclipse.team.svn.core, + de.dlr.sc.virsat.model.edit Export-Package: de.dlr.sc.virsat.server.test Automatic-Module-Name: de.dlr.sc.virsat.server.test Import-Package: de.dlr.sc.virsat.project.test, diff --git a/de.dlr.sc.virsat.server.test/pom.xml b/de.dlr.sc.virsat.server.test/pom.xml index b9101c004e..301d13a319 100644 --- a/de.dlr.sc.virsat.server.test/pom.xml +++ b/de.dlr.sc.virsat.server.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/controller/RepoManagementControllerTest.java b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/controller/RepoManagementControllerTest.java index 548eab695e..27211281e0 100644 --- a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/controller/RepoManagementControllerTest.java +++ b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/controller/RepoManagementControllerTest.java @@ -10,18 +10,26 @@ package de.dlr.sc.virsat.server.controller; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.io.File; +import java.io.IOException; import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import org.eclipse.core.runtime.CoreException; import org.junit.After; import org.junit.Before; import org.junit.Test; +import de.dlr.sc.virsat.commons.file.VirSatFileUtils; import de.dlr.sc.virsat.server.configuration.RepositoryConfiguration; +import de.dlr.sc.virsat.server.configuration.ServerConfiguration; import de.dlr.sc.virsat.server.repository.RepoRegistry; import de.dlr.sc.virsat.server.repository.ServerRepository; import de.dlr.sc.virsat.team.VersionControlSystem; @@ -32,14 +40,26 @@ public class RepoManagementControllerTest { private RepoManagementController repoManagemantController; private RepositoryConfiguration testRepositoryConfiguration; + private Path configFilePath; @Before - public void setUp() { + public void setUp() throws IOException { + // Create temporary dir for config files + Path configsDir = VirSatFileUtils.createAutoDeleteTempDirectory("test_repo_configs"); + Path projectsDir = VirSatFileUtils.createAutoDeleteTempDirectory("test_project"); + + // Overwrite path to config files + ServerConfiguration.setRepositoryConfigurationsDir(configsDir.toString()); + ServerConfiguration.setProjectRepositoriesDir(projectsDir.toString()); + repoManagemantController = new RepoManagementController(); testRepositoryConfiguration = new RepositoryConfiguration(); testRepositoryConfiguration.setProjectName(TEST_REPOSITORY_NAME); testRepositoryConfiguration.setBackend(VersionControlSystem.GIT); testRepositoryConfiguration.setRemoteUri("test.uri"); + + String expectedFileName = testRepositoryConfiguration.getProjectName() + ".properties"; + configFilePath = configsDir.resolve(expectedFileName); } @After @@ -63,43 +83,56 @@ public void testGetRepository() throws URISyntaxException { } @Test - public void testAddNewRepository() throws URISyntaxException { + public void testAddNewRepository() throws URISyntaxException, IOException { repoManagemantController.addNewRepository(testRepositoryConfiguration); ServerRepository serverRepository = RepoRegistry.getInstance().getRepository(TEST_REPOSITORY_NAME); assertEquals("Correctly added the server repository", serverRepository.getRepositoryConfiguration(), testRepositoryConfiguration); + assertTrue("Config file created", Files.exists(configFilePath)); } @Test - public void testDeleteRepository() throws URISyntaxException { + public void testDeleteRepository() throws URISyntaxException, IOException { repoManagemantController.addNewRepository(testRepositoryConfiguration); ServerRepository serverRepository = RepoRegistry.getInstance().getRepository(TEST_REPOSITORY_NAME); assertNotNull("Initially the server repository exists", serverRepository); + assertTrue("Config file exists", Files.exists(configFilePath)); repoManagemantController.deleteRepository(TEST_REPOSITORY_NAME); serverRepository = RepoRegistry.getInstance().getRepository(TEST_REPOSITORY_NAME); assertNull("Correctly deleted the server repository", serverRepository); + assertFalse("Config file deleted", Files.exists(configFilePath)); } @Test - public void testUpdateRepository() throws URISyntaxException { + public void testUpdateRepository() throws URISyntaxException, IOException, CoreException { repoManagemantController.addNewRepository(testRepositoryConfiguration); ServerRepository serverRepository = RepoRegistry.getInstance().getRepository(TEST_REPOSITORY_NAME); - assertEquals("Initially the server repository is not updated", serverRepository.getRepositoryConfiguration().getRemoteUri(), testRepositoryConfiguration.getRemoteUri()); + final String NEW_URI = "new"; + final String ACC_NAME = "name"; + final String ACC_PW = "secure"; + + assertNotEquals("Initially the server repository is not updated", serverRepository.getRepositoryConfiguration().getRemoteUri(), NEW_URI); + assertNotEquals("Initially the server repository is not updated", serverRepository.getRepositoryConfiguration().getFunctionalAccountName(), ACC_NAME); + assertNotEquals("Initially the server repository is not updated", serverRepository.getRepositoryConfiguration().getFunctionalAccountPassword(), ACC_PW); RepositoryConfiguration repositoryConfigurationNew = new RepositoryConfiguration(); repositoryConfigurationNew.setProjectName(TEST_REPOSITORY_NAME); - repositoryConfigurationNew.setRemoteUri("new"); + repositoryConfigurationNew.setRemoteUri(NEW_URI); + repositoryConfigurationNew.setFunctionalAccountName(ACC_NAME); + repositoryConfigurationNew.setFunctionalAccountPassword(ACC_PW); repoManagemantController.updateRepository(repositoryConfigurationNew); - assertEquals("Correctly caused an updated on the server repository", serverRepository.getRepositoryConfiguration().getRemoteUri(), repositoryConfigurationNew.getRemoteUri()); + assertEquals("Correctly caused an update on the server repository", serverRepository.getRepositoryConfiguration().getRemoteUri(), NEW_URI); + assertEquals("Correctly caused an update on the server repository", serverRepository.getRepositoryConfiguration().getFunctionalAccountName(), ACC_NAME); + assertEquals("Correctly caused an update on the server repository", serverRepository.getRepositoryConfiguration().getFunctionalAccountPassword(), ACC_PW); } @Test - public void testGetAllProjectNames() throws URISyntaxException { + public void testGetAllProjectNames() throws URISyntaxException, IOException { assertTrue("No projects registered initially", repoManagemantController.getAllProjectNames().isEmpty()); repoManagemantController.addNewRepository(testRepositoryConfiguration); @@ -118,12 +151,12 @@ public void testGetAllProjectNames() throws URISyntaxException { } @Test - public void testAddOrUpdateRepository() throws URISyntaxException { + public void testAddOrUpdateRepository() throws URISyntaxException, IOException, CoreException { assertTrue(repoManagemantController.getAllProjectNames().isEmpty()); repoManagemantController.addOrUpdateRepository(testRepositoryConfiguration); assertEquals("Project is added", 1, repoManagemantController.getAllProjectNames().size()); - final String newPassword = "naw password"; + final String newPassword = "new password"; testRepositoryConfiguration.setFunctionalAccountPassword(newPassword); repoManagemantController.addOrUpdateRepository(testRepositoryConfiguration); String updatedPassword = repoManagemantController.getRepository(TEST_REPOSITORY_NAME).getRepositoryConfiguration().getFunctionalAccountPassword(); diff --git a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepoHelperTest.java b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepoHelperTest.java index 37e0f7bf21..5a0d161f72 100644 --- a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepoHelperTest.java +++ b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepoHelperTest.java @@ -38,6 +38,10 @@ public class ServerRepoHelperTest { private Path configsDir; private Path svnPathRepoRemote; private URI svnUriToRemoteRepoPath; + private static final String PROJECT_NAME = "testProject"; + private static final String URI = "test.uri"; + private Path configFilePath; + private RepositoryConfiguration config; @Before public void setUp() throws IOException, CoreException { @@ -57,6 +61,14 @@ public void setUp() throws IOException, CoreException { CreateSvnServerOperation createRemoteRepoOp = new CreateSvnServerOperation(remoteRepoFilePath); createRemoteRepoOp.runWithExceptionChecking(new NullProgressMonitor()); + + config = new RepositoryConfiguration(); + config.setProjectName(PROJECT_NAME); + config.setRemoteUri(URI); + config.setBackend(VersionControlSystem.GIT); + + String expectedFileName = PROJECT_NAME + ".properties"; + configFilePath = configsDir.resolve(expectedFileName); } @After @@ -83,34 +95,51 @@ public void testLoadRepositoryConfigurations() throws IOException { @Test public void testSaveConfiguration() throws FileNotFoundException, IOException, URISyntaxException { - String projectName = "testProject"; - - String uri = "test.uri"; - RepositoryConfiguration config = new RepositoryConfiguration(); - config.setProjectName(projectName); - config.setRemoteUri(uri); - - String expectedFileName = projectName + ".properties"; - Path configFilePath = configsDir.resolve(expectedFileName); - assertFalse("Config file doesn't exist initially", Files.exists(configFilePath)); ServerRepoHelper.saveRepositoryConfiguration(config); assertTrue("Config file created after saving", Files.exists(configFilePath)); RepositoryConfiguration loadedConfig = new RepositoryConfiguration(Files.newInputStream(configFilePath)); - assertEquals("Saved file contains correct name", projectName, loadedConfig.getProjectName()); - assertEquals("Saved file contains correct URI", uri, loadedConfig.getRemoteUri()); + assertEquals("Saved file contains correct name", PROJECT_NAME, loadedConfig.getProjectName()); + assertEquals("Saved file contains correct URI", URI, loadedConfig.getRemoteUri()); - //Check overwriting + // Check overwriting String newUri = "new.test.uri"; config.setRemoteUri(newUri); ServerRepoHelper.saveRepositoryConfiguration(config); loadedConfig = new RepositoryConfiguration(Files.newInputStream(configFilePath)); - assertEquals("Saved file contains correct name", projectName, loadedConfig.getProjectName()); + assertEquals("Saved file contains correct name", PROJECT_NAME, loadedConfig.getProjectName()); assertEquals("Saved file contains new URI", newUri, loadedConfig.getRemoteUri()); } + @Test + public void testDeleteRepositoryConfiguration() throws IOException, URISyntaxException { + createTempRepoConfigFile(configsDir, PROJECT_NAME, VersionControlSystem.GIT); + + ServerRepoHelper.initRepoRegistry(); + ServerRepoHelper.saveRepositoryConfiguration(config); + assertTrue("Config file exists", Files.exists(configFilePath)); + assertFalse("Config registered", RepoRegistry.getInstance().getRepositories().isEmpty()); + + ServerRepoHelper.deleteRepositoryConfiguration(PROJECT_NAME); + assertFalse("Config file deleted", Files.exists(configFilePath)); + assertTrue("Config not registered", RepoRegistry.getInstance().getRepositories().isEmpty()); + } + + @Test + public void testUpdateRepositoryConfiguration() throws IOException, URISyntaxException, CoreException { + ServerRepoHelper.registerRepositoryConfiguration(config); + + ServerRepository repo = RepoRegistry.getInstance().getRepository(PROJECT_NAME); + assertEquals(VersionControlSystem.GIT, repo.getRepositoryConfiguration().getBackend()); + + config.setBackend(VersionControlSystem.SVN); + ServerRepoHelper.updateRepositoryConfiguration(config); + + assertEquals("Updated successful", VersionControlSystem.SVN, repo.getRepositoryConfiguration().getBackend()); + } + /** * Not creating all fields since we are not testing individual RepositoryConfiguration serialization here * @throws IOException diff --git a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepositoryTest.java b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepositoryTest.java index 9ea3ff9bba..7ef395792c 100644 --- a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepositoryTest.java +++ b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/repository/ServerRepositoryTest.java @@ -86,11 +86,13 @@ public void setUp() throws CoreException { public void testCheckoutRepository() throws Exception { ServerRepository testServerRepository = new ServerRepository(localRepoHome, testRepoConfig); - testServerRepository.checkoutRepository(); - File localRepositoryFolder = testServerRepository.getLocalRepositoryPath(); File localRepositoryGitFolder = new File(localRepositoryFolder, ".git/"); + assertTrue("Local Repository folder exists", localRepositoryFolder.exists()); + + testServerRepository.checkoutRepository(); + assertTrue("Local Repository Got Checked out", localRepositoryGitFolder.exists()); IProject checkedOutProject = ResourcesPlugin.getWorkspace().getRoot().getProject(testRepoConfig.getProjectName()); @@ -202,6 +204,9 @@ public void testUpdateOrCheckoutProject() throws Exception { IProject createdProject = testServerRepository.getProject(); assertTrue("Project is a virsat project now", VirSatProjectCommons.getAllVirSatProjects(ResourcesPlugin.getWorkspace()).contains(createdProject)); + assertNotNull("Project has an ed", testServerRepository.getEd()); + assertNotNull("Project has a resource set", testServerRepository.getResourceSet()); + assertNotNull("Project has a repository", testServerRepository.getResourceSet().getRepository()); ArrayList commitList1 = StreamSupport .stream( @@ -219,6 +224,9 @@ public void testUpdateOrCheckoutProject() throws Exception { testServerRepository2.updateOrCheckoutProject(); assertTrue("Project is a virsat project now", VirSatProjectCommons.getAllVirSatProjects(ResourcesPlugin.getWorkspace()).contains(createdProject)); + assertNotNull("Project has an ed", testServerRepository2.getEd()); + assertNotNull("Project has a resource set", testServerRepository2.getResourceSet()); + assertNotNull("Project has a repository", testServerRepository2.getResourceSet().getRepository()); ArrayList commitList2 = StreamSupport .stream( @@ -230,4 +238,17 @@ public void testUpdateOrCheckoutProject() throws Exception { assertThat("Commit List has expected size", commitList2, hasSize(2)); // CHECKSTYLE:ON } + + @Test + public void testRemoveProject() throws Exception { + ServerRepository testServerRepository = new ServerRepository(localRepoHome, testRepoConfig); + + File localRepositoryFolder = testServerRepository.getLocalRepositoryPath(); + assertTrue("Local Repository folder exists", localRepositoryFolder.exists()); + + testServerRepository.checkoutRepository(); + testServerRepository.removeRepository(); + + assertFalse("Local Repository folder got deleted", localRepositoryFolder.exists()); + } } diff --git a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/resources/ProjectManagementResourceTest.java b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/resources/ProjectManagementResourceTest.java index f9559bfe40..1691ed651e 100644 --- a/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/resources/ProjectManagementResourceTest.java +++ b/de.dlr.sc.virsat.server.test/src/de/dlr/sc/virsat/server/resources/ProjectManagementResourceTest.java @@ -14,6 +14,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; +import java.nio.file.Path; import java.util.List; import javax.ws.rs.client.Entity; @@ -24,7 +25,9 @@ import org.junit.Before; import org.junit.Test; +import de.dlr.sc.virsat.commons.file.VirSatFileUtils; import de.dlr.sc.virsat.server.configuration.RepositoryConfiguration; +import de.dlr.sc.virsat.server.configuration.ServerConfiguration; import de.dlr.sc.virsat.server.repository.RepoRegistry; import de.dlr.sc.virsat.server.test.AGitAndJettyServerTest; import de.dlr.sc.virsat.team.VersionControlSystem; @@ -34,7 +37,7 @@ public class ProjectManagementResourceTest extends AGitAndJettyServerTest { private RepositoryConfiguration testProjectConfiguration; @Before - public void setUpProjectConfiguration() { + public void setUpProjectConfiguration() throws IOException { String projectName = "testProject"; String uri = "test.project.uri"; VersionControlSystem backend = VersionControlSystem.GIT; @@ -43,6 +46,8 @@ public void setUpProjectConfiguration() { String localPath = ""; testProjectConfiguration = new RepositoryConfiguration(projectName, localPath, uri, backend, username, password); + Path pathConfigurationDir = VirSatFileUtils.createAutoDeleteTempDirectory("VirtualSatelliteServerConfiguration_"); + ServerConfiguration.setRepositoryConfigurationsDir(pathConfigurationDir.toString()); } @Test diff --git a/de.dlr.sc.virsat.server/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.server/META-INF/MANIFEST.MF index 16be4201c7..56f82ea613 100644 --- a/de.dlr.sc.virsat.server/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.server/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Headless Rest Jetty Server Bundle-SymbolicName: de.dlr.sc.virsat.server;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.server.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.server/pom.xml b/de.dlr.sc.virsat.server/pom.xml index 4f28da041f..4bfba0bff1 100644 --- a/de.dlr.sc.virsat.server/pom.xml +++ b/de.dlr.sc.virsat.server/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/controller/RepoManagementController.java b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/controller/RepoManagementController.java index 73f5007ed4..1c5350d079 100644 --- a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/controller/RepoManagementController.java +++ b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/controller/RepoManagementController.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -9,13 +9,13 @@ *******************************************************************************/ package de.dlr.sc.virsat.server.controller; -import java.io.File; +import java.io.IOException; import java.net.URISyntaxException; import java.util.Set; import de.dlr.sc.virsat.server.configuration.RepositoryConfiguration; -import de.dlr.sc.virsat.server.configuration.ServerConfiguration; import de.dlr.sc.virsat.server.repository.RepoRegistry; +import de.dlr.sc.virsat.server.repository.ServerRepoHelper; import de.dlr.sc.virsat.server.repository.ServerRepository; public class RepoManagementController { @@ -24,23 +24,16 @@ public ServerRepository getRepository(String repoName) { return RepoRegistry.getInstance().getRepository(repoName); } - /** - * Adds and registers a new project - * @param repoConfiguration project configuration - * @throws URISyntaxException - */ - public void addNewRepository(RepositoryConfiguration repoConfiguration) throws URISyntaxException { - ServerRepository repository = new ServerRepository(new File(ServerConfiguration.getProjectRepositoriesDir()), repoConfiguration); - RepoRegistry.getInstance().addRepository(repoConfiguration.getProjectName(), repository); + public void addNewRepository(RepositoryConfiguration repoConfiguration) throws URISyntaxException, IOException { + ServerRepoHelper.registerRepositoryConfiguration(repoConfiguration); } - public void deleteRepository(String repoName) { - RepoRegistry.getInstance().getRepositories().remove(repoName); + public void deleteRepository(String repoName) throws IOException { + ServerRepoHelper.deleteRepositoryConfiguration(repoName); } - public void updateRepository(RepositoryConfiguration repoConfiguration) { - ServerRepository repo = RepoRegistry.getInstance().getRepository(repoConfiguration.getProjectName()); - repo.getRepositoryConfiguration().update(repoConfiguration); + public void updateRepository(RepositoryConfiguration repoConfiguration) throws IOException { + ServerRepoHelper.updateRepositoryConfiguration(repoConfiguration); } public Set getAllProjectNames() { @@ -49,8 +42,9 @@ public Set getAllProjectNames() { /** * If a project with the name from configuration exists, it is updated, otherwise it is created. + * @throws IOException */ - public void addOrUpdateRepository(RepositoryConfiguration repoConfiguration) throws URISyntaxException { + public void addOrUpdateRepository(RepositoryConfiguration repoConfiguration) throws URISyntaxException, IOException { if (getAllProjectNames().contains(repoConfiguration.getProjectName())) { updateRepository(repoConfiguration); } else { diff --git a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepoHelper.java b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepoHelper.java index 56ef9f4640..15b1f43c0a 100644 --- a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepoHelper.java +++ b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepoHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,6 +17,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; + import de.dlr.sc.virsat.server.configuration.RepositoryConfiguration; import de.dlr.sc.virsat.server.configuration.ServerConfiguration; @@ -57,8 +58,14 @@ public static void initRepoRegistry() throws IOException { private static void registerRepositoryConfiguration(Path repositoryConfigurationFile) throws IOException, URISyntaxException { RepositoryConfiguration config = new RepositoryConfiguration(Files.newInputStream(repositoryConfigurationFile)); - ServerRepository serverRepository = new ServerRepository(new File(ServerConfiguration.getProjectRepositoriesDir()), config); - RepoRegistry.getInstance().addRepository(config.getProjectName(), serverRepository); + registerRepositoryConfiguration(config); + } + + public static void registerRepositoryConfiguration(RepositoryConfiguration repositoryConfiguration) throws URISyntaxException, IOException { + ServerRepository serverRepository = new ServerRepository(new File(ServerConfiguration.getProjectRepositoriesDir()), repositoryConfiguration); + RepoRegistry.getInstance().addRepository(repositoryConfiguration.getProjectName(), serverRepository); + + saveRepositoryConfiguration(repositoryConfiguration); } /** @@ -74,4 +81,35 @@ public static void saveRepositoryConfiguration(RepositoryConfiguration repositor repositoryConfiguration.saveProperties(propertiesStream); } } + + /** + * Delete the .properties file of the project and remove it from the repo registry + * @param repoName name of the project to be deleted + * @throws IOException + */ + public static void deleteRepositoryConfiguration(String repoName) throws IOException { + String fileName = repoName + ".properties"; + Path configFile = Paths.get(ServerConfiguration.getRepositoryConfigurationsDir(), fileName); + + Files.delete(configFile); + + RepoRegistry.getInstance().getRepositories().remove(repoName); + } + + /** + * Update a RepositoryConfiguration and the corresponding ServerRepository + * @param repositoryConfiguration + * @throws IOException + */ + public static void updateRepositoryConfiguration(RepositoryConfiguration repositoryConfiguration) throws IOException { + ServerRepository serverRepository = RepoRegistry.getInstance().getRepository(repositoryConfiguration.getProjectName()); + + RepositoryConfiguration oldConfig = serverRepository.getRepositoryConfiguration(); + + // Update the configuration and save it + if (!oldConfig.equals(repositoryConfiguration)) { + oldConfig.update(repositoryConfiguration); + saveRepositoryConfiguration(oldConfig); + } + } } diff --git a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepository.java b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepository.java index 0bda9f65f8..4a86adaba0 100644 --- a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepository.java +++ b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/repository/ServerRepository.java @@ -66,6 +66,10 @@ public ServerRepository(File localRepositoryHome, RepositoryConfiguration reposi this.repositoryConfiguration = repositoryConfiguration; this.localRepository = new File(localRepositoryHome, PREFIX_LOCAL_REPO_NAME + repositoryConfiguration.getProjectName()); + if (!localRepository.exists()) { + localRepository.mkdir(); + } + //checkout the project to workspace String userName = Objects.toString(repositoryConfiguration.getFunctionalAccountName(), ""); String userPass = Objects.toString(repositoryConfiguration.getFunctionalAccountPassword(), ""); @@ -159,7 +163,10 @@ public void removeRepository() throws CoreException, IOException { project.delete(true, true, progress); Path localRepositoryPath = getLocalRepositoryPath().toPath(); - Files.walk(localRepositoryPath).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); + // could already be removed by project delete + if (localRepositoryPath.toFile().exists()) { + Files.walk(localRepositoryPath).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete); + } project = null; resourceSet = null; @@ -236,6 +243,8 @@ public void updateOrCheckoutProject() throws Exception { if (!project.exists()) { checkoutRepository(); + } else { + retrieveEdAndResurceSetFromConfiguration(); } syncRepository(); diff --git a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/resources/ProjectManagementResource.java b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/resources/ProjectManagementResource.java index 78a14a6664..246e98337e 100644 --- a/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/resources/ProjectManagementResource.java +++ b/de.dlr.sc.virsat.server/src/de/dlr/sc/virsat/server/resources/ProjectManagementResource.java @@ -9,6 +9,7 @@ *******************************************************************************/ package de.dlr.sc.virsat.server.resources; +import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -64,10 +65,18 @@ public Response getProject(@PathParam("projectName") String projectName) { } } + /** + * Deletes a project + * @param repoName name of the project to delete + */ @DELETE @Path("/{projectName}") public Response deleteProject(@PathParam("projectName") String repoName) { - controller.deleteRepository(repoName); + try { + controller.deleteRepository(repoName); + } catch (IOException e) { + return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).build(); + } return Response.status(Response.Status.OK).build(); } diff --git a/de.dlr.sc.virsat.swtbot.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.swtbot.test/META-INF/MANIFEST.MF index 46811953f5..57a5c31504 100644 --- a/de.dlr.sc.virsat.swtbot.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.swtbot.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core UI Tests with SwtBot Bundle-SymbolicName: de.dlr.sc.virsat.swtbot.test;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.swt, @@ -58,10 +58,12 @@ Require-Bundle: org.eclipse.swt, de.dlr.sc.virsat.model.extension.requirements.ui, de.dlr.sc.virsat.model.extension.statemachines, de.dlr.sc.virsat.model.extension.statemachines.ui, + de.dlr.sc.virsat.excel, + de.dlr.sc.virsat.excel.ui, + de.dlr.sc.virsat.external.lib.spotbugs, org.eclipse.gef, org.eclipse.jgit, - org.eclipse.team.svn.core, - de.dlr.sc.virsat.external.lib.spotbugs + org.eclipse.team.svn.core Import-Package: org.eclipse.draw2d.geometry, org.zeromq, vtk, diff --git a/de.dlr.sc.virsat.swtbot.test/pom.xml b/de.dlr.sc.virsat.swtbot.test/pom.xml index 6984917c70..28a40b60c9 100644 --- a/de.dlr.sc.virsat.swtbot.test/pom.xml +++ b/de.dlr.sc.virsat.swtbot.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 @@ -30,7 +30,7 @@ SPDX-License-Identifier: EPL-2.0 - 1200 + 1800 true true 3 diff --git a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ASwtBotTestCase.java b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ASwtBotTestCase.java index d8de423928..4c02c8eab4 100644 --- a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ASwtBotTestCase.java +++ b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ASwtBotTestCase.java @@ -88,20 +88,21 @@ public class ASwtBotTestCase { protected static final String SWTBOT_CANVAS_FIELD_REFLECTION_NAME = "canvas"; protected static final int SWTBOT_GENERAL_WAIT_TIME = 50; protected static final int MAX_TEST_CASE_TIMEOUT_SECONDS = 90; - protected static final int MAX_TEST_CASE_TIMEOUT_MILLISECONDS = 1000 * MAX_TEST_CASE_TIMEOUT_SECONDS; + public static final int MAX_TEST_CASE_TIMEOUT_MILLISECONDS = 1000 * MAX_TEST_CASE_TIMEOUT_SECONDS; protected static final int EDIT_UNDO_MENU_POSITION = 0; protected static final int EDIT_REDO_MENU_POSITION = 1; protected static final int SWTBOT_TRY_1_TIME = 1; protected static final int SWTBOT_TRY_3_TIME = 3; protected static final int SWTBOT_TRY_5_TIME = 5; protected static final int SWTBOT_TRY_10_TIME = 10; - protected static final int SWTBOT_RETRY_WAIT_TIME = 500; + public static final int SWTBOT_RETRY_WAIT_TIME = 500; protected SWTWorkbenchBot bot; protected IProject project; protected Concept conceptPs; protected Concept conceptTest; protected Concept conceptFea; + protected Concept conceptMaturity; protected int screenCaptureNumber = 1; protected WorkspaceBuilderInterlockedExecution buildCounter; protected enum DiagramType { interfaces, stateMachines } @@ -134,6 +135,7 @@ public void before() throws Exception { conceptPs = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.ps.Activator.getPluginId() + "/concept/concept.xmi"); conceptTest = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.tests.Activator.getPluginId() + "/concept/concept.xmi"); conceptFea = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.funcelectrical.Activator.getPluginId() + "/concept/concept.xmi"); + conceptMaturity = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.maturity.Activator.getPluginId() + "/concept/concept.xmi"); closeWelcomeScreen(); @@ -804,7 +806,15 @@ protected SWTBotTable getSWTBotTable(SWTBotTreeItem item, String tableName) { * @return it returns the desired section name */ protected String getSectionName(Class clazz) { - return "Section for: " + clazz.getSimpleName(); + return getSectionName(clazz.getSimpleName()); + } + + /** + * @param sectionContent + * @return section name for arbitrary content string + */ + protected String getSectionName(String sectionContent) { + return "Section for: " + sectionContent; } /** diff --git a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/EditorTest.java b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/EditorTest.java index f9986887cc..23928ec890 100644 --- a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/EditorTest.java +++ b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/EditorTest.java @@ -10,6 +10,7 @@ package de.dlr.sc.virsat.swtbot.test; import static org.eclipse.swtbot.swt.finder.SWTBotAssert.assertText; +import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; @@ -29,17 +30,27 @@ import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Status; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Button; import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; import org.junit.Before; import org.junit.Test; import de.dlr.sc.virsat.model.dvlm.structural.StructuralElementInstance; +import de.dlr.sc.virsat.model.extension.maturity.model.Maturity; import de.dlr.sc.virsat.model.extension.ps.model.ConfigurationTree; import de.dlr.sc.virsat.model.extension.ps.model.Document; import de.dlr.sc.virsat.model.extension.ps.model.ElementConfiguration; import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryAllProperty; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryCompositionArray; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryIntrinsicArray; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryReference; +import de.dlr.sc.virsat.model.extension.tests.model.TestCategoryReferenceArray; +import de.dlr.sc.virsat.model.extension.tests.model.TestMassParameters; import de.dlr.sc.virsat.project.Activator; import de.dlr.sc.virsat.project.editingDomain.VirSatEditingDomainRegistry; import de.dlr.sc.virsat.project.editingDomain.VirSatTransactionalEditingDomain; @@ -52,7 +63,6 @@ * */ public class EditorTest extends ASwtBotTestCase { - private static final int THREE = 3; SWTBotTreeItem repositoryNavigatorItem; SWTBotTreeItem configurationTree; @@ -146,9 +156,11 @@ public void openEditorsforSEIsendCAsTest() { @Test public void addAndremoveCategoriesFromSEIEditor() { + final int EXPECTED_EC_CHILDREN = 3; + openEditor(elementConfiguration); bot.button("Add Document").click(); - assertEquals(THREE, elementConfiguration.getItems().length); + assertEquals(EXPECTED_EC_CHILDREN, elementConfiguration.getItems().length); save(); bot.tableWithLabel(getSectionName(Document.class)).click(0, 0); @@ -175,37 +187,272 @@ public void collapseSections() { } @Test - public void editStringProperty() { - // Edit from editor - openEditor(document); - renameField(Document.PROPERTY_DOCUMENTNAME, "NewName"); - assertText("NewName", bot.textWithLabel(Document.PROPERTY_DOCUMENTNAME)); - //change string from table - SWTBotTable documentTable = getSWTBotTable(elementConfiguration, Document.class); - // change the value from the table - setTableValue(documentTable, 0, 1, "NewName", "NewNewName"); - // test the new values - openEditor(document); - assertText("NewNewName", bot.textWithLabel(Document.PROPERTY_DOCUMENTNAME)); - } - - @Test - public void editStringPropertyandFloatProperty() { + public void editPrimitiveProperties() { + // A resource can't be tested via the SWTBot, + // because it doesn't support the native file selection dialog + + final String NEW_NAME = "NewName"; + final String NEW_NAME_2 = "NewNewName"; + final String NEW_FLOAT = "6.976"; + final String NEW_FLOAT_2 = "8.569"; + final String NEW_INT = "35"; + final String NEW_INT_2 = "42"; + final String NEW_BOOL = "true"; + final String NEW_BOOL_2 = "false"; + + final int COLUMN_STRING = 1; + final int COLUMN_INT = 2; + final int COLUMN_FLOAT = 3; + final int COLUMN_BOOL = 4; + allProperty = addElement(TestCategoryAllProperty.class, conceptTest, elementConfiguration); // Edit from editor openEditor(allProperty); - renameField(TestCategoryAllProperty.PROPERTY_TESTSTRING, "NewName"); - renameField(TestCategoryAllProperty.PROPERTY_TESTFLOAT, "6.976"); - assertText("NewName", bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTSTRING)); - assertText("6.976", bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTFLOAT)); + + renameField(TestCategoryAllProperty.PROPERTY_TESTSTRING, NEW_NAME); + renameField(TestCategoryAllProperty.PROPERTY_TESTFLOAT, NEW_FLOAT); + renameField(TestCategoryAllProperty.PROPERTY_TESTINT, NEW_INT); + bot.comboBoxWithLabel(TestCategoryAllProperty.PROPERTY_TESTBOOL).setSelection(NEW_BOOL); + + assertText(NEW_NAME, bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTSTRING)); + assertText(NEW_FLOAT, bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTFLOAT)); + assertText(NEW_INT, bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTINT)); + assertText(NEW_BOOL, bot.comboBoxWithLabel(TestCategoryAllProperty.PROPERTY_TESTBOOL)); + SWTBotTable allPropertyTable = getSWTBotTable(elementConfiguration, TestCategoryAllProperty.class); - // change the values from the table - setTableValue(allPropertyTable, 0, 1, "NewName", "NewNewName"); - setTableValue(allPropertyTable, 0, THREE, "6.976", "8.569"); - // test the new values + // Change the values from the table + setTableValue(allPropertyTable, 0, COLUMN_STRING, NEW_NAME, NEW_NAME_2); + setTableValue(allPropertyTable, 0, COLUMN_FLOAT, NEW_FLOAT, NEW_FLOAT_2); + setTableValue(allPropertyTable, 0, COLUMN_INT, NEW_INT, NEW_INT_2); + allPropertyTable.doubleClick(0, COLUMN_BOOL); + bot.ccomboBox().setSelection(NEW_BOOL_2); + + // Test the new values openEditor(allProperty); - assertText("NewNewName", bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTSTRING)); - assertText("8.569", bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTFLOAT)); + + assertText(NEW_NAME_2, bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTSTRING)); + assertText(NEW_FLOAT_2, bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTFLOAT)); + assertText(NEW_INT_2, bot.textWithLabel(TestCategoryAllProperty.PROPERTY_TESTINT)); + assertText(NEW_BOOL_2, bot.comboBoxWithLabel(TestCategoryAllProperty.PROPERTY_TESTBOOL)); + } + + @Test + public void editEnumProperties() { + final String NEW_LEVEL = "READY_TO_BE_USED=1"; + final String NEW_LEVEL_2 = "HAS_TO_BE_MODIFIED=2"; + final String NEW_TRL = "TRL_5=5"; + final String NEW_TRL_2 = "TRL_4=4"; + + SWTBotTreeItem maturity = addElement(Maturity.class, conceptMaturity, elementConfiguration); + + // Edit from editor + openEditor(maturity); + + bot.comboBoxWithLabel(Maturity.PROPERTY_LEVEL).setSelection(NEW_LEVEL); + bot.comboBoxWithLabel(Maturity.PROPERTY_TRL).setSelection(NEW_TRL); + + assertText(NEW_LEVEL, bot.comboBoxWithLabel(Maturity.PROPERTY_LEVEL)); + assertText(NEW_TRL, bot.comboBoxWithLabel(Maturity.PROPERTY_TRL)); + + SWTBotTable maturityTable = getSWTBotTable(elementConfiguration, Maturity.class); + + // Change the values from the table + maturityTable.doubleClick(0, 1); + bot.ccomboBox().setSelection(NEW_LEVEL_2); + + maturityTable.doubleClick(0, 2); + bot.ccomboBox().setSelection(NEW_TRL_2); + + // Test the new values + openEditor(maturity); + + assertText(NEW_LEVEL_2, bot.comboBoxWithLabel(Maturity.PROPERTY_LEVEL)); + assertText(NEW_TRL_2, bot.comboBoxWithLabel(Maturity.PROPERTY_TRL)); + } + + @Test + public void editReference() { + allProperty = addElement(TestCategoryAllProperty.class, conceptTest, elementConfiguration); + + SWTBotTreeItem reference = addElement(TestCategoryReference.class, conceptTest, elementConfiguration); + openEditor(reference); + + SWTBotTable referenceTable = getSWTBotTable(elementConfiguration, TestCategoryReference.class); + referenceTable.doubleClick(0, 1); + + bot.button("...").click(); + + SWTBotShell shell = bot.shell("Select Reference to Object"); + shell.bot().tree().getTreeItem("CT: ConfigurationTree").click(); + shell.bot().table().getTableItem("TCAP: TestCategoryAllProperty - ConfigurationTree.ElementConfiguration.TestCategoryAllProperty").doubleClick(); + + openEditor(reference); + assertText("TestCategoryAllProperty - ElementConfiguration.TestCategoryAllProperty", bot.textWithLabel(TestCategoryReference.PROPERTY_TESTREFCATEGORY)); + } + + @Test + public void drillDownCaToReferencedCa() throws InterruptedException { + allProperty = addElement(TestCategoryAllProperty.class, conceptTest, elementConfiguration); + SWTBotTreeItem reference = addElement(TestCategoryReference.class, conceptTest, elementConfiguration); + + openEditor(reference); + bot.button("Select Reference").click(); + SWTBotShell shell = bot.shell("Select Reference to Object"); + shell.bot().tree().getTreeItem("CT: ConfigurationTree").click(); + shell.bot().table().getTableItem("TCAP: TestCategoryAllProperty - ConfigurationTree.ElementConfiguration.TestCategoryAllProperty").doubleClick(); + + assertEquals("TCR: TestCategoryReference -> ConfigurationTree.ElementConfiguration.TestCategoryReference", bot.activeEditor().getTitle()); + bot.button("Drill-Down").click(); + assertEquals("TCAP: TestCategoryAllProperty -> ConfigurationTree.ElementConfiguration.TestCategoryAllProperty", bot.activeEditor().getTitle()); + } + + @Test + public void drillDownCaTableToCa() throws InterruptedException { + openEditor(elementConfiguration); + SWTBotTable documentTable = getSWTBotTable(elementConfiguration, Document.class); + + SwtBotSection documentSection = getSWTBotSection(Document.class); + + SWTBotButton button = new SWTBotButton((Button) bot.widget(withText("Drill-Down"), documentSection.widget)); + assertFalse(button.isEnabled()); + + documentTable.click(0, 0); + + assertTrue(button.isEnabled()); + button.click(); + assertEquals("D: Document -> ConfigurationTree.ElementConfiguration.Document", bot.activeEditor().getTitle()); + } + + @Test + public void editDynamicStringArray() { + final String ELEMENT_1 = "a"; + final String ELEMENT_2 = "b"; + final String ELEMENT_3 = "c"; + final int NUMBER_OF_ELEMENTS = 3; + + SWTBotTreeItem arrays = addElement(TestCategoryIntrinsicArray.class, conceptTest, elementConfiguration); + openEditor(arrays); + + SWTBotTable dynamicArrayTable = getSWTBotTable(arrays, getSectionName(TestCategoryIntrinsicArray.PROPERTY_TESTSTRINGARRAYDYNAMIC)); + + bot.button("Add testStringArrayDynamic").click(); + setTableValue(dynamicArrayTable, 0, 1, "", ELEMENT_1); + bot.text(ELEMENT_1).pressShortcut(SWT.CR, SWT.LF); + + bot.button("Add testStringArrayDynamic").click(); + setTableValue(dynamicArrayTable, 1, 1, "", ELEMENT_2); + bot.text(ELEMENT_2).pressShortcut(SWT.CR, SWT.LF); + + bot.button("Add testStringArrayDynamic").click(); + setTableValue(dynamicArrayTable, 2, 1, "", ELEMENT_3); + bot.text(ELEMENT_3).pressShortcut(SWT.CR, SWT.LF); + + SWTBotTable parentTable = getSWTBotTable(elementConfiguration, TestCategoryIntrinsicArray.class); + + assertEquals(NUMBER_OF_ELEMENTS, dynamicArrayTable.rowCount()); + assertEquals(ELEMENT_1 + ',' + ELEMENT_2 + ',' + ELEMENT_3, parentTable.cell(0, 1)); + + openEditor(arrays); + dynamicArrayTable.click(1, 0); + bot.button("Remove testStringArrayDynamic").click(); + + openEditor(elementConfiguration); + assertEquals(NUMBER_OF_ELEMENTS - 1, dynamicArrayTable.rowCount()); + assertEquals(ELEMENT_1 + ',' + ELEMENT_3, parentTable.cell(0, 1)); + } + + @Test + public void editDynamicReferenceArray() { + allProperty = addElement(TestCategoryAllProperty.class, conceptTest, elementConfiguration); + + SWTBotTreeItem arrays = addElement(TestCategoryReferenceArray.class, conceptTest, elementConfiguration); + openEditor(arrays); + + SWTBotTable dynamicArrayTable = getSWTBotTable(arrays, getSectionName(TestCategoryReferenceArray.PROPERTY_TESTCATEGORYREFERENCEARRAYDYNAMIC)); + + bot.button("Add testCategoryReferenceArrayDynamic").click(); + dynamicArrayTable.doubleClick(0, 1); + bot.button("...").click(); + + SWTBotShell shell = bot.shell("Select Reference to Object"); + shell.bot().tree().getTreeItem("CT: ConfigurationTree").click(); + shell.bot().table().getTableItem("TCAP: TestCategoryAllProperty - ConfigurationTree.ElementConfiguration.TestCategoryAllProperty").doubleClick(); + + SWTBotTable parentTable = getSWTBotTable(elementConfiguration, TestCategoryReferenceArray.class); + + assertEquals(1, dynamicArrayTable.rowCount()); + assertEquals("TestCategoryAllProperty", parentTable.cell(0, 1)); + + openEditor(arrays); + dynamicArrayTable.click(0, 1); + bot.button("Remove testCategoryReferenceArrayDynamic").click(); + + openEditor(elementConfiguration); + assertEquals(0, dynamicArrayTable.rowCount()); + assertEquals("", parentTable.cell(0, 1)); + } + + @Test + public void editDynamicCompositionArray() { + SWTBotTreeItem arrays = addElement(TestCategoryCompositionArray.class, conceptTest, elementConfiguration); + openEditor(arrays); + + SWTBotTable dynamicArrayTable = getSWTBotTable(arrays, getSectionName( + TestCategoryCompositionArray.PROPERTY_TESTCOMPOSITIONARRAYDYNAMIC + + " - TestCategoryAllProperty")); + + bot.button("Add TestCategoryAllProperty").click(); + + SWTBotTable parentTable = getSWTBotTable(elementConfiguration, TestCategoryCompositionArray.class); + + assertEquals(1, dynamicArrayTable.rowCount()); + assertEquals("testCompositionArrayDynamic", parentTable.cell(0, 1)); + + openEditor(arrays); + dynamicArrayTable.click(0, 0); + bot.button("Remove TestCategoryAllProperty").click(); + + openEditor(elementConfiguration); + assertEquals(0, dynamicArrayTable.rowCount()); + assertEquals("", parentTable.cell(0, 1)); + } + + @Test + public void editStaticStringArray() { + String[] testValues = {"a", "b", "c", "d"}; + + SWTBotTreeItem arrays = addElement(TestCategoryIntrinsicArray.class, conceptTest, elementConfiguration); + openEditor(arrays); + + SWTBotTable staticArrayTable = getSWTBotTable(arrays, getSectionName(TestCategoryIntrinsicArray.PROPERTY_TESTSTRINGARRAYSTATIC)); + + for (int i = 0; i < testValues.length; i++) { + setTableValue(staticArrayTable, i, 1, "", testValues[i]); + bot.text(testValues[i]).pressShortcut(SWT.CR, SWT.LF); + } + + SWTBotTable parentTable = getSWTBotTable(elementConfiguration, TestCategoryIntrinsicArray.class); + + String expectedTableValue = String.join(",", testValues); + assertEquals(expectedTableValue, parentTable.cell(0, 2)); + } + + @Test + public void addAndRemoveCategoryWithCardinalityOne() { + SWTBotTable massParamsTable = getSWTBotTable(elementConfiguration, TestMassParameters.class); + + assertEquals(0, massParamsTable.rowCount()); + bot.checkBox("Test Mass Parameters").click(); + assertEquals(1, massParamsTable.rowCount()); + + assertEquals("EC: ElementConfiguration -> ConfigurationTree.ElementConfiguration", bot.activeEditor().getTitle()); + massParamsTable.select("TestMassParameters"); + massParamsTable.contextMenu().menu("Drill-DownTestMassParameters").click(); + assertEquals("TMP: TestMassParameters -> ConfigurationTree.ElementConfiguration.TestMassParameters", bot.activeEditor().getTitle()); + + openEditor(elementConfiguration); + bot.checkBox("Test Mass Parameters").click(); + assertEquals(0, massParamsTable.rowCount()); } } diff --git a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ExporterImporterWizardTest.java b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ExporterImporterWizardTest.java new file mode 100644 index 0000000000..307e5b5449 --- /dev/null +++ b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ExporterImporterWizardTest.java @@ -0,0 +1,217 @@ +/******************************************************************************* + * Copyright (c) 2020 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.swtbot.test; + +import static org.eclipse.swtbot.swt.finder.SWTBotAssert.assertText; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.nio.file.Path; + +import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; +import org.junit.Test; + +import de.dlr.sc.virsat.commons.file.VirSatFileUtils; +import de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.extension.budget.mass.model.MassEquipment; +import de.dlr.sc.virsat.model.extension.funcelectrical.model.InterfaceEnd; +import de.dlr.sc.virsat.model.extension.ps.model.ConfigurationTree; +import de.dlr.sc.virsat.model.extension.ps.model.ElementConfiguration; +import de.dlr.sc.virsat.model.extension.visualisation.model.Visualisation; + +public class ExporterImporterWizardTest extends ASwtBotTestCase { + + private static final String TEST_EXPORT_FOLDER = "SWTBOT_TEST_EXPORT_FILES"; + private static final String[] CT_PATH = { SWTBOT_TEST_PROJECTNAME, "Repository", "CT: ConfigurationTree" }; + private static final String[] EC_PATH = { SWTBOT_TEST_PROJECTNAME, "Repository", "CT: ConfigurationTree", "EC: ElementConfiguration" }; + + private Path exportFolderPath; + private SWTBotTreeItem ct; + private SWTBotTreeItem ec; + + @Override + public void before() throws Exception { + super.before(); + exportFolderPath = VirSatFileUtils.createAutoDeleteTempDirectory(TEST_EXPORT_FOLDER); + + SWTBotTreeItem repositoryNavigatorItem = bot.tree().expandNode(SWTBOT_TEST_PROJECTNAME, "Repository"); + ct = addElement(ConfigurationTree.class, conceptPs, repositoryNavigatorItem); + ec = addElement(ElementConfiguration.class, conceptPs, ct); + } + + @Test + public void testExcelExportImportFEA() { + SWTBotTreeItem interfaceEnd = addElement(InterfaceEnd.class, conceptFea, ec); + openEditor(interfaceEnd); + openVirSatExporter("Excel Export Wizard"); + + // Configure the export + bot.tree().expandNode(EC_PATH).select(); + bot.checkBox("Use default template").click(); + bot.comboBox().setText(exportFolderPath.toString()); + finishWizard(); + + // Cause a change + assertText(InterfaceEnd.class.getSimpleName(), bot.textWithLabel("Name")); + rename(interfaceEnd, "changedName"); + assertText("changedName", bot.textWithLabel("Name")); + + // Assert that we correctly exported a file + final String EXPECTED_EXCEL_FILE_NAME = "ConfigurationTree.ElementConfiguration.xlsx"; + File excelExportFile = exportFolderPath.resolve(EXPECTED_EXCEL_FILE_NAME).toFile(); + assertTrue("A file has been successfully created.", excelExportFile.exists()); + + openVirSatImporter("Excel Import Wizard"); + + // Configure the import + bot.tree().expandNode(EC_PATH).select(); + bot.comboBox().setText(excelExportFile.getPath()); + finishWizard(); + + // Check that the imported name has been applied + assertText(InterfaceEnd.class.getSimpleName(), bot.textWithLabel("Name")); + } + + @Test + public void testHTMLExportFEA() { + SWTBotTreeItem interfaceEnd = addElement(InterfaceEnd.class, conceptFea, ec); + openEditor(interfaceEnd); + openVirSatExporter("Functional Electrical Architecture to HTML Export Wizard"); + + // Configure the export + bot.tree().expandNode(CT_PATH).select(); + bot.comboBox().setText(exportFolderPath.toString()); + finishWizard(); + + // Assert that we correctly exported the HTML files + File htmlExportIndexFile = exportFolderPath.resolve("index.htm").toFile(); + Path resourcesFolderPath = exportFolderPath.resolve("resources"); + File htmlExportCTFile = resourcesFolderPath.resolve("ConfigurationTree.htm").toFile(); + File htmlExportECFile = resourcesFolderPath.resolve("ElementConfiguration.htm").toFile(); + assertTrue("Index file has been successfully created.", htmlExportIndexFile.exists()); + assertTrue("ConfigurationTree file has been successfully created.", htmlExportCTFile.exists()); + assertTrue("ElementConfiguration file has been successfully created.", htmlExportECFile.exists()); + } + + @Test + public void testMatExportImport() { + Concept conceptMass = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.budget.mass.Activator.getPluginId() + "/concept/concept.xmi"); + SWTBotTreeItem massEquipment = addElement(MassEquipment.class, conceptMass, ec); + openEditor(massEquipment); + + final String OLD_VALUE = "45.0"; + final String NEW_VALUE = "30.0"; + + renameField(MassEquipment.PROPERTY_MASS, OLD_VALUE); + + openVirSatExporter("Mat Export Wizard"); + + // Configure the export + bot.tree().expandNode(EC_PATH).select(); + Path matExportFilePath = exportFolderPath.resolve("export.mat"); + bot.comboBox().setText(matExportFilePath.toString()); + finishWizard(); + + // Assert that we correctly exported a file + assertTrue("A file has been successfully created.", matExportFilePath.toFile().exists()); + + // Cause a change + renameField(MassEquipment.PROPERTY_MASS, NEW_VALUE); + + openVirSatImporter("Mat Import Wizard"); + + // Configure the import + bot.tree().expandNode(EC_PATH).select(); + bot.comboBox().setText(matExportFilePath.toString()); + finishWizard(); + + // Check that the imported value has been applied + assertText(OLD_VALUE, bot.textWithLabel(MassEquipment.PROPERTY_MASS)); + } + + @Test + public void testCadExportImport() { + Concept conceptVisualisation = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.visualisation.Activator.getPluginId() + "/concept/concept.xmi"); + SWTBotTreeItem visualisation = addElement(Visualisation.class, conceptVisualisation, ec); + openEditor(visualisation); + + // In order for a object to be exported, it must have a shape + bot.comboBoxWithLabel(Visualisation.PROPERTY_SHAPE).setSelection(Visualisation.SHAPE_BOX_NAME); + + final String OLD_VALUE = "45.0"; + final String NEW_VALUE = "30.0"; + + renameField(Visualisation.PROPERTY_POSITIONX, OLD_VALUE); + + openVirSatExporter("Cad Export Wizard"); + + // Configure the export + bot.tree().expandNode(CT_PATH).select(); + Path cadExportFilePath = exportFolderPath.resolve("export.json"); + bot.comboBox().setText(cadExportFilePath.toString()); + finishWizard(); + + // Assert that we correctly exported a file + assertTrue("A file has been successfully created.", cadExportFilePath.toFile().exists()); + + // Cause a change + renameField(Visualisation.PROPERTY_POSITIONX, NEW_VALUE); + + openVirSatImporter("Cad Import Wizard"); + + // Configure the import + bot.tree().expandNode(CT_PATH).select(); + bot.comboBox().setText(cadExportFilePath.toString()); + finishWizard(); + + // Check that the imported value has been applied + assertText(OLD_VALUE, bot.textWithLabel(Visualisation.PROPERTY_POSITIONX)); + } + + /** + * Helper function to open the given virsat exporter + * @param exporterName the name of the exporter + */ + private void openVirSatExporter(String exporterName) { + bot.menu("File").menu("Export...").click(); + openVirSatWizard(exporterName); + } + + /** + * Helper function to open the given virsat importer + * @param importerName the name of the importer + */ + private void openVirSatImporter(String importerName) { + bot.menu("File").menu("Import...").click(); + openVirSatWizard(importerName); + } + + /** + * Go to the Virtual Satellite category and select the wizard + * @param wizardName the wizard to select + */ + private void openVirSatWizard(String wizardName) { + bot.tree().expandNode("Virtual Satellite", wizardName).select(); + bot.button("Next >").click(); + waitForEditingDomainAndUiThread(); + } + + /** + * Closes a import/export wizard by pressing the finish button. + */ + private void finishWizard() { + finishDialog(); + + // Workaround to shells sometimes not being valid anymore after closing a wizard + // See https://wiki.eclipse.org/SWTBot/Troubleshooting#WidgetNotFoundException_when_stepping_through_SWTBot_test_in_Eclipse_debugger for details + bot.shell().activate(); + } +} diff --git a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/LicenseTest.java b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/LicenseTest.java new file mode 100644 index 0000000000..8e2ba2d88c --- /dev/null +++ b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/LicenseTest.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.swtbot.test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import org.eclipse.swtbot.eclipse.finder.waits.Conditions; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotTableItem; +import org.junit.Test; + +public class LicenseTest extends ASwtBotTestCase { + + @Test + public void licenseTest() { + final String VIRSAT_PACKAGE_PREFIX = "de.dlr.sc.virsat"; + final String EXPECTED_PROVIDER = "DLR (German Aerospace Center)"; + + final int COLUMN_PLUGIN_ID = 4; + + bot.menu("Help").menu("About VirSat 4 - Core").click(); + bot.button("Installation Details").click(); + + bot.cTabItem("Plug-ins").activate(); + + // Wait until plugin table is populated + bot.waitWhile(Conditions.tableHasRows(bot.table(), 0), ASwtBotTestCase.MAX_TEST_CASE_TIMEOUT_MILLISECONDS, ASwtBotTestCase.SWTBOT_RETRY_WAIT_TIME); + + assertTrue("There is at least one VirSat plugin", bot.table().containsText(EXPECTED_PROVIDER)); + + int rowCount = bot.table().rowCount(); + for (int i = 0; i < rowCount; i++) { + SWTBotTableItem row = bot.table().getTableItem(i); + String pluginId = row.getText(COLUMN_PLUGIN_ID); + if (pluginId.startsWith(VIRSAT_PACKAGE_PREFIX)) { + bot.table().select(i); + assertEquals("Correct provider for plugin " + pluginId, EXPECTED_PROVIDER, row.getText(1)); + assertTrue("Licensing information is set (about.html is present and added to build.properties) for plugin " + pluginId, bot.button("Legal Info").isEnabled()); + } + } + + // Close installation details and about window + bot.button("Close").click(); + bot.button("Close").click(); + } + +} diff --git a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/PowerSummaryTest.java b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/PowerSummaryTest.java new file mode 100644 index 0000000000..a34c780d88 --- /dev/null +++ b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/PowerSummaryTest.java @@ -0,0 +1,100 @@ +/******************************************************************************* + * Copyright (c) 2008-2019 German Aerospace Center (DLR), Simulation and Software Technology, Germany. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package de.dlr.sc.virsat.swtbot.test; + + +import static org.junit.Assert.assertEquals; + +import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; +import org.junit.Before; +import org.junit.Test; + +import de.dlr.sc.virsat.concept.unittest.util.ConceptXmiLoader; +import de.dlr.sc.virsat.model.dvlm.concepts.Concept; +import de.dlr.sc.virsat.model.extension.budget.power.model.PowerEquipment; +import de.dlr.sc.virsat.model.extension.budget.power.model.PowerState; +import de.dlr.sc.virsat.model.extension.budget.power.model.PowerSummary; +import de.dlr.sc.virsat.model.extension.ps.model.ConfigurationTree; +import de.dlr.sc.virsat.model.extension.ps.model.ElementConfiguration; + +public class PowerSummaryTest extends ASwtBotTestCase { + private SWTBotTreeItem repositoryNavigatorItem; + + private SWTBotTreeItem configurationTree; + private SWTBotTreeItem elementConfiguration1; + private SWTBotTreeItem elementConfiguration2; + + private static final Double AOCS_POWER = 20.0; + private static final Double AOCS_DUTYCYCLE = 20.0; + + private static final Double DATA_HANDLING_POWER = 50.0; + private static final Double DATA_HANDLING_DUTYCYCLE = 50.0; + + private SWTBotTreeItem powerEquipment1; + private SWTBotTreeItem powerEquipment2; + + private Concept conceptPower; + + @Before + public void before() throws Exception { + super.before(); + //create necessary items for the test + conceptPower = ConceptXmiLoader.loadConceptFromPlugin(de.dlr.sc.virsat.model.extension.budget.power.Activator.getPluginId() + "/concept/concept.xmi"); + + repositoryNavigatorItem = bot.tree().expandNode(SWTBOT_TEST_PROJECTNAME, "Repository"); + + configurationTree = addElement(ConfigurationTree.class, conceptPs, repositoryNavigatorItem); + + elementConfiguration1 = addElement(ElementConfiguration.class, conceptPs, configurationTree); + rename(elementConfiguration1, "AOCS"); + + powerEquipment1 = addElement(PowerEquipment.class, conceptPower, elementConfiguration1); + openEditor(powerEquipment1); + + bot.button("Add PowerState").click(); + bot.table().select("powerValues"); + bot.button("Drill-Down").click(); + renameField(PowerState.PROPERTY_POWER, String.valueOf(AOCS_POWER)); + renameField(PowerState.PROPERTY_DUTYCYCLE, String.valueOf(AOCS_DUTYCYCLE)); + + elementConfiguration2 = addElement(ElementConfiguration.class, conceptPs, configurationTree); + rename(elementConfiguration2, "DataHandling"); + + powerEquipment2 = addElement(PowerEquipment.class, conceptPower, elementConfiguration2); + openEditor(powerEquipment2); + + bot.button("Add PowerState").click(); + bot.table().select("powerValues"); + bot.button("Drill-Down").click(); + + renameField(PowerState.PROPERTY_POWER, String.valueOf(DATA_HANDLING_POWER)); + renameField(PowerState.PROPERTY_DUTYCYCLE, String.valueOf(DATA_HANDLING_DUTYCYCLE)); + + addElement(PowerSummary.class, conceptPower, configurationTree); + save(); + } + + @Test + public void calculationsForPowerSummaryTest() { + openEditor(configurationTree); + SWTBotTable allPropertyTable = getSWTBotTable(configurationTree, "Section for: PowerSummary"); + + final int AVERAGE_POWER_INDEX = 1; //averagePower is located in second column of power summary table + String averagePower = allPropertyTable.getTableItem(0).getText(AVERAGE_POWER_INDEX); + final String expectedAveragePower = AOCS_POWER * (AOCS_DUTYCYCLE / 100) + DATA_HANDLING_POWER * (DATA_HANDLING_DUTYCYCLE / 100) + "00 [W]"; + assertEquals(expectedAveragePower, averagePower); + + final int MIN_POWER_INDEX = 2; // minPower is located in third column of power summary table + String minPower = allPropertyTable.getTableItem(0).getText(MIN_POWER_INDEX); + final String expectedMinPower = AOCS_POWER + DATA_HANDLING_POWER + "00 [W]"; + assertEquals(expectedMinPower, minPower); + } +} diff --git a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ProjectUiAllTests.java b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ProjectUiAllTests.java index b46e816603..d945af9a51 100644 --- a/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ProjectUiAllTests.java +++ b/de.dlr.sc.virsat.swtbot.test/src/de/dlr/sc/virsat/swtbot/test/ProjectUiAllTests.java @@ -30,9 +30,12 @@ FuncElectricalDiagramTest.class, EditorTest.class, NewProjectWizardTest.class, + ExporterImporterWizardTest.class, CutCopyDeleteUndoTest.class, InheritanceTest.class, CalculationTest.class, + LicenseTest.class, + PowerSummaryTest.class, ProductStructureTest.class, RoleManagementTest.class, GitVersioningBackendTest.class, diff --git a/de.dlr.sc.virsat.target.feature/feature.xml b/de.dlr.sc.virsat.target.feature/feature.xml index 10dbd0b8be..af073f7c49 100644 --- a/de.dlr.sc.virsat.target.feature/feature.xml +++ b/de.dlr.sc.virsat.target.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.target.feature/pom.xml b/de.dlr.sc.virsat.target.feature/pom.xml index 5482f63a9f..85ba94599c 100644 --- a/de.dlr.sc.virsat.target.feature/pom.xml +++ b/de.dlr.sc.virsat.target.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.target.feature diff --git a/de.dlr.sc.virsat.target/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.target/META-INF/MANIFEST.MF index 62f98094af..72821491a1 100644 --- a/de.dlr.sc.virsat.target/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.target/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Target Bundle-SymbolicName: de.dlr.sc.virsat.target -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Vendor: DLR (German Aerospace Center) Eclipse-ExtensibleAPI: true Automatic-Module-Name: de.dlr.sc.virsat.target diff --git a/de.dlr.sc.virsat.target/pom.xml b/de.dlr.sc.virsat.target/pom.xml index 2a0905525c..db164d982f 100644 --- a/de.dlr.sc.virsat.target/pom.xml +++ b/de.dlr.sc.virsat.target/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml @@ -81,9 +81,9 @@ SPDX-License-Identifier: EPL-2.0 - virsat.target + virsat_windows.target target - virsat + virsat_windows diff --git a/de.dlr.sc.virsat.target/tmodel-src/virsat.tmodel b/de.dlr.sc.virsat.target/tmodel-src/virsat.tmodel index cf65e82579..da9dbe458f 100644 --- a/de.dlr.sc.virsat.target/tmodel-src/virsat.tmodel +++ b/de.dlr.sc.virsat.target/tmodel-src/virsat.tmodel @@ -1,10 +1,4 @@ - Target virsat { - OperatingSystem win32 - WorkingSystem win32 - Architecture x86_64 - Locale de_DE - TargetJRE JavaSE-1.8 - +TargetLibrary virsat { RepositoryLocation Nebula url "https://download.eclipse.org/nebula/releases/2.2.0/"{ Unit org.eclipse.nebula.widgets.gallery.feature.feature.group version 1.0.0.201907151344; Unit org.eclipse.nebula.widgets.tablecombo.feature.feature.group version 1.2.0.201907151344; diff --git a/de.dlr.sc.virsat.target/tmodel-src/virsat_linux.tmodel b/de.dlr.sc.virsat.target/tmodel-src/virsat_linux.tmodel new file mode 100644 index 0000000000..621f1b93dc --- /dev/null +++ b/de.dlr.sc.virsat.target/tmodel-src/virsat_linux.tmodel @@ -0,0 +1,9 @@ +Target virsat_linux { + Import virsat + + OperatingSystem linux + WindowingSystem gtk + Architecture x86_64 + Locale de_DE + TargetJRE JavaSE-1.8 +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.target/tmodel-src/virsat_windows.tmodel b/de.dlr.sc.virsat.target/tmodel-src/virsat_windows.tmodel new file mode 100644 index 0000000000..3dd71d1db8 --- /dev/null +++ b/de.dlr.sc.virsat.target/tmodel-src/virsat_windows.tmodel @@ -0,0 +1,9 @@ +Target virsat_windows { + Import virsat + + OperatingSystem win32 + WindowingSystem win32 + Architecture x86_64 + Locale de_DE + TargetJRE JavaSE-1.8 +} \ No newline at end of file diff --git a/de.dlr.sc.virsat.target/virsat_linux.target b/de.dlr.sc.virsat.target/virsat_linux.target new file mode 100644 index 0000000000..f332fb29bd --- /dev/null +++ b/de.dlr.sc.virsat.target/virsat_linux.target @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + linux + gtk + x86_64 + de_DE + + + diff --git a/de.dlr.sc.virsat.target/virsat.target b/de.dlr.sc.virsat.target/virsat_windows.target similarity index 94% rename from de.dlr.sc.virsat.target/virsat.target rename to de.dlr.sc.virsat.target/virsat_windows.target index e4f39cca07..dc592129fa 100644 --- a/de.dlr.sc.virsat.target/virsat.target +++ b/de.dlr.sc.virsat.target/virsat_windows.target @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - win32 - win32 - x86_64 - de_DE - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + win32 + win32 + x86_64 + de_DE + + + diff --git a/de.dlr.sc.virsat.team.feature/feature.xml b/de.dlr.sc.virsat.team.feature/feature.xml index 3dfea29357..4f52506983 100644 --- a/de.dlr.sc.virsat.team.feature/feature.xml +++ b/de.dlr.sc.virsat.team.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/de.dlr.sc.virsat.team.feature/pom.xml b/de.dlr.sc.virsat.team.feature/pom.xml index 15e545f221..bb87419b30 100644 --- a/de.dlr.sc.virsat.team.feature/pom.xml +++ b/de.dlr.sc.virsat.team.feature/pom.xml @@ -18,7 +18,7 @@ SPDX-License-Identifier: EPL-2.0 ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.team.feature diff --git a/de.dlr.sc.virsat.team.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.team.test/META-INF/MANIFEST.MF index c94502b6c7..77d8d11af4 100644 --- a/de.dlr.sc.virsat.team.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.team.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Simple Team Connector Tests Bundle-SymbolicName: de.dlr.sc.virsat.team.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Fragment-Host: de.dlr.sc.virsat.team;bundle-version="0.0.1" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.team.test/pom.xml b/de.dlr.sc.virsat.team.test/pom.xml index 7d507512c1..d1d7f67c4a 100644 --- a/de.dlr.sc.virsat.team.test/pom.xml +++ b/de.dlr.sc.virsat.team.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.team.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.team.ui/META-INF/MANIFEST.MF index f989cfc45e..710f65be83 100644 --- a/de.dlr.sc.virsat.team.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.team.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Simple Team Connector UI Bundle-SymbolicName: de.dlr.sc.virsat.team.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.team.ui.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.ui, diff --git a/de.dlr.sc.virsat.team.ui/pom.xml b/de.dlr.sc.virsat.team.ui/pom.xml index 50e164a605..6954339b74 100644 --- a/de.dlr.sc.virsat.team.ui/pom.xml +++ b/de.dlr.sc.virsat.team.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.team/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.team/META-INF/MANIFEST.MF index 4a990fc6c5..55e0f453d7 100644 --- a/de.dlr.sc.virsat.team/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.team/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Simple Team Connector Bundle-SymbolicName: de.dlr.sc.virsat.team -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.team.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.team/pom.xml b/de.dlr.sc.virsat.team/pom.xml index 6953c7bf26..edceb00b10 100644 --- a/de.dlr.sc.virsat.team/pom.xml +++ b/de.dlr.sc.virsat.team/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.test.feature/feature.xml b/de.dlr.sc.virsat.test.feature/feature.xml index 469aca5878..3e96f17ffd 100644 --- a/de.dlr.sc.virsat.test.feature/feature.xml +++ b/de.dlr.sc.virsat.test.feature/feature.xml @@ -2,7 +2,7 @@ @@ -80,7 +80,7 @@ by German Aerospace Center (DLR e.V.) - + ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.test.feature diff --git a/de.dlr.sc.virsat.test/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.test/META-INF/MANIFEST.MF index 9172a40d95..fb95093f18 100644 --- a/de.dlr.sc.virsat.test/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core General Tests Bundle-SymbolicName: de.dlr.sc.virsat.test -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-Activator: de.dlr.sc.virsat.plugin.Activator Bundle-Vendor: DLR (German Aerospace Center) Require-Bundle: org.eclipse.core.runtime, diff --git a/de.dlr.sc.virsat.test/pom.xml b/de.dlr.sc.virsat.test/pom.xml index 928d0f9995..246ee73b46 100644 --- a/de.dlr.sc.virsat.test/pom.xml +++ b/de.dlr.sc.virsat.test/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.uiengine.feature/feature.xml b/de.dlr.sc.virsat.uiengine.feature/feature.xml index 9a85bfea23..019ff23efb 100644 --- a/de.dlr.sc.virsat.uiengine.feature/feature.xml +++ b/de.dlr.sc.virsat.uiengine.feature/feature.xml @@ -2,7 +2,7 @@ @@ -51,7 +51,7 @@ by German Aerospace Center (DLR e.V.) - + ../maven/pom.xml de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT de.dlr.sc.virsat.uiengine.feature diff --git a/de.dlr.sc.virsat.uiengine.ui/META-INF/MANIFEST.MF b/de.dlr.sc.virsat.uiengine.ui/META-INF/MANIFEST.MF index 7927538c72..bfc2cc888e 100644 --- a/de.dlr.sc.virsat.uiengine.ui/META-INF/MANIFEST.MF +++ b/de.dlr.sc.virsat.uiengine.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: VirSat Core Generic UI Engine and Editor UI Bundle-SymbolicName: de.dlr.sc.virsat.uiengine.ui;singleton:=true -Bundle-Version: 4.12.0.qualifier +Bundle-Version: 4.12.1.qualifier Bundle-ClassPath: . Bundle-Activator: de.dlr.sc.virsat.uieingine.ui.DVLMEditorPlugin$Implementation Bundle-Vendor: DLR (German Aerospace Center) diff --git a/de.dlr.sc.virsat.uiengine.ui/pom.xml b/de.dlr.sc.virsat.uiengine.ui/pom.xml index 1672fd9ed8..bdfa70fa7f 100644 --- a/de.dlr.sc.virsat.uiengine.ui/pom.xml +++ b/de.dlr.sc.virsat.uiengine.ui/pom.xml @@ -13,7 +13,7 @@ SPDX-License-Identifier: EPL-2.0 de.dlr.sc.virsat.parent de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT ../maven/pom.xml 4.0.0 diff --git a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/cellEditor/aproperties/ReferencePropertyCellEditingSupport.java b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/cellEditor/aproperties/ReferencePropertyCellEditingSupport.java index dc5f71bfe2..575b5494a4 100644 --- a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/cellEditor/aproperties/ReferencePropertyCellEditingSupport.java +++ b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/cellEditor/aproperties/ReferencePropertyCellEditingSupport.java @@ -24,6 +24,7 @@ import org.eclipse.jface.viewers.CellEditor; import org.eclipse.jface.viewers.ColumnViewer; import org.eclipse.jface.viewers.DialogCellEditor; +import org.eclipse.jface.viewers.ViewerCell; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; @@ -154,6 +155,11 @@ protected Object getValue(Object element) { return value; } + @Override + protected void initializeCellEditorValue(CellEditor cellEditor, ViewerCell cell) { + cellEditor.setValue(cell.getText()); + } + @Override protected boolean canEdit(Object element) { boolean canEdit = createSetCommand(element, null).canExecute(); diff --git a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/AUiSnippetGenericTable.java b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/AUiSnippetGenericTable.java index c7d10dd6d6..6ef60127cc 100644 --- a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/AUiSnippetGenericTable.java +++ b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/AUiSnippetGenericTable.java @@ -317,9 +317,13 @@ protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent even // Also in case return is pressed a cell editor should be opened. boolean isReturnPressed = (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR); + // Also in case F2 is pressed a cell editor should be opened. + boolean isF2Pressed = (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.F2); + // Now bring together all behavior with the standard behavior of traversing and programmatic calls to cell editors return isReturnPressed || singleSelect && (isLeftMouseSelect || isLeftMouseSelectAgain + || isF2Pressed || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC || event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL ); diff --git a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/general/UiSnippetBetaWarning.java b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/general/UiSnippetBetaWarning.java index 7bbbe765e9..460541b2b5 100644 --- a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/general/UiSnippetBetaWarning.java +++ b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/editor/snippets/general/UiSnippetBetaWarning.java @@ -132,7 +132,7 @@ protected String createDescriptionLabel() { description.append(" "); } - description.append("should not be used in productive envrionment!"); + description.append("should not be used in productive environment!"); return description.toString(); } diff --git a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/wizard/AImportExportPage.java b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/wizard/AImportExportPage.java index f4bc7601d8..9936a75327 100644 --- a/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/wizard/AImportExportPage.java +++ b/de.dlr.sc.virsat.uiengine.ui/src/de/dlr/sc/virsat/uiengine/ui/wizard/AImportExportPage.java @@ -10,6 +10,8 @@ package de.dlr.sc.virsat.uiengine.ui.wizard; import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -79,9 +81,6 @@ public void handleEvent(Event event) { if (selectedDirectoryName != null) { setErrorMessage(null); destinationField.setText(selectedDirectoryName); - isDestinationSelected = true; - getDialogSettings().put(DESTINATION_FILE_KEY, selectedDirectoryName); - setPageComplete(isComplete()); } } }); @@ -126,11 +125,24 @@ public void createDestinationField() { data.widthHint = DESTINATION_WIDTH_HINT; destinationField.setLayoutData(data); + destinationField.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + String selectedDirectoryName = destinationField.getText(); + if (selectedDirectoryName.equals("")) { + isDestinationSelected = false; + } else { + isDestinationSelected = true; + getDialogSettings().put(DESTINATION_FILE_KEY, selectedDirectoryName); + } + + setPageComplete(isComplete()); + } + }); + String defaultDestination = getDialogSettings().get(DESTINATION_FILE_KEY); - if (defaultDestination != null) { destinationField.setText(defaultDestination); - isDestinationSelected = true; } } diff --git a/maven/pom.xml b/maven/pom.xml index 8287b8c71b..f4c496e7ae 100644 --- a/maven/pom.xml +++ b/maven/pom.xml @@ -10,7 +10,7 @@ 4.0.0 de.dlr.sc.virsat de.dlr.sc.virsat.parent - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT pom @@ -19,7 +19,7 @@ 1.20 UTF-8 - 4.12.0 + 4.12.1 't'yyyyMMddHHmm 't'yyyyMMddHHmm ../builds @@ -280,8 +280,8 @@ de.dlr.sc.virsat de.dlr.sc.virsat.target - 4.12.0-SNAPSHOT - virsat + 4.12.1-SNAPSHOT + virsat_windows diff --git a/pom.xml b/pom.xml index 7423cdf220..f74ea1c868 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ 4.0.0 de.dlr.sc.virsat de.dlr.sc.virsat - 4.12.0-SNAPSHOT + 4.12.1-SNAPSHOT pom