Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-02-20 17:53:13 +0000
committerCamille Letavernier2014-02-25 16:20:02 +0000
commitfebcbd860c478bb7ea05b0087bd745a2c04fc4df (patch)
tree5c2ea5b333194879e9948cdeb9db4f67d3dac076 /plugins/sysml
parent00ca40181412dbac25e77d0e9a71d37e2535c567 (diff)
downloadorg.eclipse.papyrus-febcbd860c478bb7ea05b0087bd745a2c04fc4df.tar.gz
org.eclipse.papyrus-febcbd860c478bb7ea05b0087bd745a2c04fc4df.tar.xz
org.eclipse.papyrus-febcbd860c478bb7ea05b0087bd745a2c04fc4df.zip
366029: [Model Explorer] It is impossible to see the additionnal
resources https://bugs.eclipse.org/bugs/show_bug.cgi?id=366029 - Fix profile Property Testers to avoid loading profiles in the current model - Deprecate DiModel (Redundant with SashModel) - Display external resources (libraries) in the ModelExplorer (And other tree-based views)
Diffstat (limited to 'plugins/sysml')
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java41
1 files changed, 23 insertions, 18 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java
index bdf8a3f464c..93e96ee7244 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java
@@ -7,7 +7,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
+ *
* CEA LIST - Initial API and implementation
*
*****************************************************************************/
@@ -19,14 +19,9 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForSelection;
-import org.eclipse.papyrus.sysml.SysmlPackage;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
import org.eclipse.papyrus.uml.tools.model.UmlModel;
import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.util.UMLUtil;
/**
* This class is a Property tester used to check is current model (meaning the model currently opened in Papyrus) is a SysML Model.
@@ -75,10 +70,15 @@ public class SysMLSelectionTester extends PropertyTester {
EObject root = getRoot(receiver);
if(root instanceof Package) {
- Profile sysml = UMLUtil.getProfile(SysmlPackage.eINSTANCE, root);
- if(((Package)root).isProfileApplied(sysml)) {
- isSysMLModel = true;
- }
+
+ return (((Package)root).getAppliedProfile("SysML") != null);
+
+ //FIX: UMLUtil.getProfile() loads the profile into the resource set. This is not desired.
+ //
+ // Profile sysml = UMLUtil.getProfile(SysmlPackage.eINSTANCE, root);
+ // if(((Package)root).isProfileApplied(sysml)) {
+ // isSysMLModel = true;
+ // }
}
return isSysMLModel;
@@ -90,10 +90,13 @@ public class SysMLSelectionTester extends PropertyTester {
EObject root = getRoot(receiver);
if(root instanceof Package) {
- Profile sysml = UMLUtil.getProfile(RequirementsPackage.eINSTANCE, root);
- if(((Package)root).isProfileApplied(sysml)) {
- isSysMLModel = true;
- }
+ return (((Package)root).getAppliedProfile("SysML::Requirements") != null);
+
+ //FIX: UMLUtil.getProfile() loads the profile into the resource set. This is not desired.
+ // Profile sysml = UMLUtil.getProfile(RequirementsPackage.eINSTANCE, root);
+ // if(((Package)root).isProfileApplied(sysml)) {
+ // isSysMLModel = true;
+ // }
}
return isSysMLModel;
@@ -105,10 +108,12 @@ public class SysMLSelectionTester extends PropertyTester {
EObject root = getRoot(receiver);
if(root instanceof Package) {
- Profile sysml = UMLUtil.getProfile(BlocksPackage.eINSTANCE, root);
- if(((Package)root).isProfileApplied(sysml)) {
- isSysMLModel = true;
- }
+ return (((Package)root).getAppliedProfile("SysML::Blocks") != null);
+ //FIX: UMLUtil.getProfile() loads the profile into the resource set. This is not desired.
+ // Profile sysml = UMLUtil.getProfile(BlocksPackage.eINSTANCE, root);
+ // if(((Package)root).isProfileApplied(sysml)) {
+ // isSysMLModel = true;
+ // }
}
return isSysMLModel;

Back to the top