Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuai Li2015-02-27 12:32:47 +0000
committerShuai Li2015-03-11 17:07:16 +0000
commit1abca4be4770c6675e48ae7e8e7e9f35908f86e8 (patch)
treeeb7d006621e25e6ad9752c2e2daedd7f3cb5545b /plugins/uml/org.eclipse.papyrus.uml.search.ui/src/org/eclipse/papyrus/uml/search/ui/validator/ParticipantValidator.java
parent9173f56602ecbc75928f3ea01fc5c9d3289109f0 (diff)
downloadorg.eclipse.papyrus-1abca4be4770c6675e48ae7e8e7e9f35908f86e8.tar.gz
org.eclipse.papyrus-1abca4be4770c6675e48ae7e8e7e9f35908f86e8.tar.xz
org.eclipse.papyrus-1abca4be4770c6675e48ae7e8e7e9f35908f86e8.zip
Bug 461822 - [Search] Results display performance and monitoring
Bug 432834 - [Performances - Search] The search operation loads models into the active ModelSet - Added progress monitor - Delay search results refresh to avoid UI getting stuck - Also fixes modelset bug Change-Id: I8fa0244225c4cb4f11209a6b2cf14bcf52585242 Signed-off-by: Shuai Li <shuai.li@cea.fr>
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.java15
1 files changed, 11 insertions, 4 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 d652c7641eb..731d302be67 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
@@ -22,6 +22,8 @@ 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.papyrus.infra.core.resource.ModelUtils;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
@@ -88,15 +90,20 @@ public class ParticipantValidator implements IParticipantValidator {
while (it.hasNext()) {
EObject modelElement = it.next();
if (modelElement instanceof Element) {
- for (Stereotype appliedStereotype : ((Element) modelElement).getAppliedStereotypes()) {
- // Check that metaclass of this element is a supported metaclass
- for (Object stereotypeToGet : participantsTypesList) {
- if (EcoreUtil.equals(appliedStereotype, (EObject) stereotypeToGet)) {
+ for (Object participantStereotype : participantsTypes) {
+ if (participantStereotype instanceof Stereotype) {
+ if (StereotypeUtil.isApplied((Element) modelElement, ((Stereotype) participantStereotype).getQualifiedName())) {
results.add(modelElement);
break;
}
}
}
+
+ /**
+ * EcoreUtil.equals is slow which has a big impact when searching in models of more than 100 elements.
+ * The temporary solution may raise a bug in the future.
+ */
+ //if (EcoreUtil.equals(appliedStereotype, (EObject) participantStereotype)) {
}
}

Back to the top