Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2016-01-14 11:39:28 +0000
committerCamille Letavernier2016-01-18 12:43:44 +0000
commit85d6ec3fa77fb0f9c1b847ed5b4d6d5632d99685 (patch)
treea32bad556a8b7ead11557ae746070a8577621db4 /plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui
parentf22f9045b39f31d578db43b5a55a381b12829b47 (diff)
downloadorg.eclipse.papyrus-85d6ec3fa77fb0f9c1b847ed5b4d6d5632d99685.tar.gz
org.eclipse.papyrus-85d6ec3fa77fb0f9c1b847ed5b4d6d5632d99685.tar.xz
org.eclipse.papyrus-85d6ec3fa77fb0f9c1b847ed5b4d6d5632d99685.zip
485539: [Performances - Facet Manager] FacetManager recomputes the
Facets for a given element too many times https://bugs.eclipse.org/bugs/show_bug.cgi?id=485539 - Move some methods from FacetUtils to FacetManager and use a cache for meta-elements (Facets) - Avoid checking facet conformance when the Facet doesn't contain any useful typed element (Operation or Feature) Change-Id: If8837433b876385a77b67cf04d5b7792ae018338 Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
Diffstat (limited to 'plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui')
-rw-r--r--plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java
index 73052bca244..f66e76bb384 100644
--- a/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java
+++ b/plugins/facet/org.eclipse.papyrus.emf.facet.custom.ui/src/org/eclipse/papyrus/emf/facet/custom/ui/internal/CustomizedTreeContentProvider.java
@@ -219,7 +219,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv
Logger.logError(e, Activator.getDefault());
}
- final Collection<Object> children = new ArrayList<Object>();
+ final Collection<TreeElement> children = new ArrayList<TreeElement>();
createAttributes(treeElement, facetFeatures, children);
createReferences(treeElement, facetFeatures, children);
return children.toArray();
@@ -378,7 +378,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv
- private void createReferences(final EObjectTreeElement treeElement, Collection<EStructuralFeature> facetFeatures, Collection<Object> children) {
+ private void createReferences(final EObjectTreeElement treeElement, Collection<EStructuralFeature> facetFeatures, Collection<TreeElement> children) {
final EObject eObject = treeElement.getEObject();
for (EReference next : getVisibleReferences(eObject)) {
@@ -391,12 +391,12 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv
}
}
- private void createReference(EObjectTreeElement treeElement, EObject eObject, EReference eReference, Collection<Object> children) {
+ private void createReference(EObjectTreeElement treeElement, EObject eObject, EReference eReference, Collection<TreeElement> children) {
if (collapseLink(eObject, eReference)) {
if (eReference.getUpperBound() != 1) {
collectMultiValuedReferenceChildren(eReference, eObject, treeElement, children);
} else {
- Object child = getSingleValuedReferenceChild(eReference, eObject, treeElement);
+ EObjectTreeElement child = getSingleValuedReferenceChild(eReference, eObject, treeElement);
if (child != null) {
children.add(child);
}
@@ -406,7 +406,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv
}
}
- private void createAttributes(final EObjectTreeElement treeElement, Collection<EStructuralFeature> facetFeatures, Collection<? super TreeElement> children) {
+ private void createAttributes(final EObjectTreeElement treeElement, Collection<EStructuralFeature> facetFeatures, Collection<TreeElement> children) {
final EObject eObject = treeElement.getEObject();
for (EAttribute next : getVisibleAttributes(eObject)) {
@@ -463,8 +463,8 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv
return attributeProxy;
}
- private Object getSingleValuedReferenceChild(final EReference eReference, final EObject eObject, final TreeElement parent) {
- Object child = null;
+ private EObjectTreeElement getSingleValuedReferenceChild(final EReference eReference, final EObject eObject, final TreeElement parent) {
+ EObjectTreeElement child = null;
try {
final IFacetManager facetManager = this.customManager.getFacetManager();
final Object result = facetManager.getOrInvoke(eObject, eReference, null);
@@ -478,7 +478,7 @@ public class CustomizedTreeContentProvider implements ICustomizedTreeContentProv
return child;
}
- private void collectMultiValuedReferenceChildren(final EReference eReference, final EObject eObject, final TreeElement parent, Collection<Object> children) {
+ private void collectMultiValuedReferenceChildren(final EReference eReference, final EObject eObject, final TreeElement parent, Collection<TreeElement> children) {
try {
final IFacetManager facetManager = this.customManager.getFacetManager();
final List<Object> result = facetManager.getOrInvokeMultiValued(eObject, eReference, null);

Back to the top