diff options
author | Florian Noyrit | 2013-07-30 08:57:26 +0000 |
---|---|---|
committer | Florian Noyrit | 2013-07-30 08:57:26 +0000 |
commit | 2b8765d82cbb57fc898c2022cec9726139300c5b (patch) | |
tree | 24d52b043c0dc697616fb7a2f25dc0d0c8068041 /plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java | |
parent | 0cf8e396f1c70664a78562f7a07bffd7479bacd0 (diff) | |
download | org.eclipse.papyrus-2b8765d82cbb57fc898c2022cec9726139300c5b.tar.gz org.eclipse.papyrus-2b8765d82cbb57fc898c2022cec9726139300c5b.tar.xz org.eclipse.papyrus-2b8765d82cbb57fc898c2022cec9726139300c5b.zip |
Search model element by types (UML metaclass or stereotype). No pointer
to matching element in results. Update results when models are modified.
Update OCL search.
Diffstat (limited to 'plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java')
-rw-r--r-- | plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java b/plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java index 177ff26c248..38eb000b851 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java +++ b/plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java @@ -19,7 +19,9 @@ import java.util.Collection; import java.util.List;
import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
@@ -59,8 +61,9 @@ public class ParticipantValidator implements IParticipantValidator { TreeIterator<EObject> it = root.eAllContents();
while(it.hasNext()) {
EObject modelElement = (EObject)it.next();
- //Check that metaclass of this element is a supported metaclass
+ //Check that metaclass of this element is a supported metaclass
+ EClass e = modelElement.eClass();
if(participantsTypesList.contains(modelElement.eClass())) {
results.add(modelElement);
}
@@ -85,10 +88,10 @@ public class ParticipantValidator implements IParticipantValidator { while(it.hasNext()) {
EObject modelElement = (EObject)it.next();
if(modelElement instanceof Element) {
- for(Stereotype element : ((Element)modelElement).getAppliedStereotypes()) {
+ for(Stereotype appliedStereotype : ((Element)modelElement).getAppliedStereotypes()) {
//Check that metaclass of this element is a supported metaclass
for(Object stereotypeToGet : participantsTypesList) {
- if(element.getName().equals(((Stereotype)stereotypeToGet).getName())) {
+ if(EcoreUtil.equals(appliedStereotype, (EObject)stereotypeToGet)) {
results.add(modelElement);
}
}
|