Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Noyrit2013-12-20 11:36:46 -0500
committerFlorian Noyrit2013-12-20 11:36:46 -0500
commit4a9f359e3739e41c0d34e39072f52b14a66f1772 (patch)
tree50ae1aa6e76775c79cdb41707e1c19de0e3da4dc /plugins/views/org.eclipse.papyrus.views.search
parent91f76f6759821005495bcaed00f4cd2410155d98 (diff)
downloadorg.eclipse.papyrus-4a9f359e3739e41c0d34e39072f52b14a66f1772.tar.gz
org.eclipse.papyrus-4a9f359e3739e41c0d34e39072f52b14a66f1772.tar.xz
org.eclipse.papyrus-4a9f359e3739e41c0d34e39072f52b14a66f1772.zip
Update search to support "AND" semantics on stereotype application of
selected stereotypes. Replace is now based on refactoring framework.
Diffstat (limited to 'plugins/views/org.eclipse.papyrus.views.search')
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/regex/PatternHelper.java5
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java3
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java7
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/ModelElementMatch.java12
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeCollector.java13
-rw-r--r--plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/validator/ParticipantValidator.java8
6 files changed, 27 insertions, 21 deletions
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/regex/PatternHelper.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/regex/PatternHelper.java
index 2ad1497849b..96495a60fed 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/regex/PatternHelper.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/regex/PatternHelper.java
@@ -35,14 +35,13 @@ public class PatternHelper {
* @return the helper
*/
public final static PatternHelper getInstance() {
-
- if(PatternHelper.instance == null) {
+
synchronized(PatternHelper.class) {
if(PatternHelper.instance == null) {
PatternHelper.instance = new PatternHelper();
}
}
- }
+
return PatternHelper.instance;
}
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java
index fc5ca9fb494..5fdc926872d 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AbstractResultEntry.java
@@ -266,5 +266,8 @@ public abstract class AbstractResultEntry extends Match {
return this.getClass().getSimpleName() + "(" + super.hashCode() + ") : source -> " + source; //$NON-NLS-1$ //$NON-NLS-2$
}
+ public URI getURI() {
+ return uriSource;
+ }
}
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java
index 0a7996d6c0b..6434bc83e45 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/AttributeMatch.java
@@ -33,7 +33,7 @@ public class AttributeMatch extends ModelMatch {
* The element containing the value of the attribute that matches
*/
- protected URI uriSource;
+
protected Object attribute;
@@ -182,4 +182,9 @@ public class AttributeMatch extends ModelMatch {
this.stereotype = stereotype;
}
+ public URI getURISource() {
+
+ return uriSource;
+ }
+
}
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/ModelElementMatch.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/ModelElementMatch.java
index 122f40dd1a0..c560deb82dc 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/ModelElementMatch.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/results/ModelElementMatch.java
@@ -39,17 +39,7 @@ public class ModelElementMatch extends ModelMatch {
@Override
public boolean equals(Object obj) {
- // if(obj instanceof ModelElementMatch) {
- // if(super.equals(obj)) {
- //
- // return true;
- //
- // }
- // return false;
- //
- // } else {
- // return false;
- // }
+
return super.equals(obj);
}
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeCollector.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeCollector.java
index 74f22d98d04..091fa55d35c 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeCollector.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/scope/ScopeCollector.java
@@ -38,10 +38,10 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.papyrus.views.search.Activator;
import org.eclipse.search.ui.ISearchPageContainer;
import org.eclipse.ui.IWorkingSet;
-
+
public class ScopeCollector implements IScopeCollector {
- private static final ScopeCollector instance = new ScopeCollector();
+ private static ScopeCollector instance = new ScopeCollector();
private final Iterable<? extends IScopeProvider> scopeProviders;
@@ -52,6 +52,15 @@ public class ScopeCollector implements IScopeCollector {
}
public final static ScopeCollector getInstance() {
+
+
+
+ synchronized(ScopeCollector.class) {
+ if(ScopeCollector.instance == null) {
+ ScopeCollector.instance = new ScopeCollector();
+
+ }
+ }
return ScopeCollector.instance;
}
diff --git a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/validator/ParticipantValidator.java b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/validator/ParticipantValidator.java
index ddc4a7825df..e592897ece8 100644
--- a/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/validator/ParticipantValidator.java
+++ b/plugins/views/org.eclipse.papyrus.views.search/src/org/eclipse/papyrus/views/search/validator/ParticipantValidator.java
@@ -36,11 +36,11 @@ public class ParticipantValidator implements IParticipantValidator {
public final static ParticipantValidator getInstance() {
- if(ParticipantValidator.instance == null) {
+
synchronized(ParticipantValidator.class) {
- if(ParticipantValidator.instance == null) {
- ParticipantValidator.instance = new ParticipantValidator();
- }
+ if(ParticipantValidator.instance == null) {
+ ParticipantValidator.instance = new ParticipantValidator();
+
}
}
return ParticipantValidator.instance;

Back to the top