diff options
| author | Camille Letavernier | 2016-01-06 10:54:55 +0000 |
|---|---|---|
| committer | Camille Letavernier | 2016-01-06 10:55:04 +0000 |
| commit | fc06e2bba73aa5f351575fc33e5d1d9c30fda6ba (patch) | |
| tree | 4ec6e533c11db281f81b6e47070fd571ccf68f40 | |
| parent | 8aff72194308bd9f09ffb4941014a537d7341cf7 (diff) | |
| download | org.eclipse.papyrus-fc06e2bba73aa5f351575fc33e5d1d9c30fda6ba.tar.gz org.eclipse.papyrus-fc06e2bba73aa5f351575fc33e5d1d9c30fda6ba.tar.xz org.eclipse.papyrus-fc06e2bba73aa5f351575fc33e5d1d9c30fda6ba.zip | |
Bug 485259: [Performances - Properties View] Opening a Reference browser
is
slow on big models
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485259
Change-Id: Icb6dbe05b31b342c9c6271ef4f1b4bc1a39a0c40
Signed-off-by: Camille Letavernier <camille.letavernier@cea.fr>
4 files changed, 24 insertions, 1 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java index d1c69487e6b..746d71885de 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/providers/EMFLabelProvider.java @@ -86,7 +86,7 @@ public class EMFLabelProvider extends ResolvingCustomizedLabelProvider implement if (selection.size() == 1) {
return getText(selection.getFirstElement());
} else {
- final List<Object> selectionAsList = selection.toList();
+ final List<?> selectionAsList = selection.toList();
String str = "";
for (int i = 0; i < selectionAsList.size(); i++) {
final String txt = getText(selectionAsList.get(i));
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/IRequestCacheEntries.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/IRequestCacheEntries.java index cd9e4f22df4..91ee99a9c3f 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/IRequestCacheEntries.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/IRequestCacheEntries.java @@ -32,5 +32,8 @@ public interface IRequestCacheEntries { /** Defined in org.eclipse.gmf.runtime.emf.type.core.internal.requests.RequestCacheEntries (internal) */ public static final String Client_Context = "Client_Context";//$NON-NLS-1$ + + /** Defined in org.eclipse.gmf.runtime.emf.type.core.internal.requests.RequestCacheEntries (internal) */ + public static final String Dependent_Elements = "Dependent_Elements";//$NON-NLS-1$ } diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/RequestCacheEntries.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/RequestCacheEntries.java index 3741bc80dd0..ac17be25214 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/RequestCacheEntries.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.edit/src/org/eclipse/papyrus/infra/services/edit/utils/RequestCacheEntries.java @@ -14,6 +14,7 @@ *****************************************************************************/ package org.eclipse.papyrus.infra.services.edit.utils; +import java.util.HashSet; import java.util.Map; import org.eclipse.emf.ecore.EObject; @@ -42,6 +43,9 @@ public final class RequestCacheEntries implements IRequestCacheEntries { IEditHelperAdvice[] advices = ElementTypeRegistry.getInstance() .getEditHelperAdvice(eObj, clientContext); map.put(EditHelper_Advice, advices); + + map.put(IRequestCacheEntries.Dependent_Elements, new HashSet<Object>()); //The set will be populated on the fly + map.put(IRequestCacheEntries.Checked_Elements, new HashSet<Object>()); //The set will be populated on the fly } }
\ No newline at end of file diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java index 8df51421cc1..bce8b435026 100644 --- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java +++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java @@ -11,13 +11,18 @@ *****************************************************************************/
package org.eclipse.papyrus.uml.tools.providers;
+import java.util.HashMap;
+import java.util.Map;
+
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.services.edit.utils.RequestCacheEntries;
import org.eclipse.papyrus.uml.tools.Activator;
/**
@@ -35,6 +40,8 @@ public class EditServiceValidator { private EStructuralFeature editedFeature;
private IElementEditService editingService;
+
+ private Map<String, Object> adviceCache;
/**
* Constructor
@@ -54,6 +61,14 @@ public class EditServiceValidator { // log error service not found...
Activator.log.warn("Could not create service for " + EMFCoreUtil.getQualifiedName(editedEObject, true));
}
+
+ //Bug 485259: Use a cache for the advices, as we will build many SetRequests for the same element type
+ adviceCache = new HashMap<String, Object>();
+ try {
+ RequestCacheEntries.initializeEObjCache(editedEObject, adviceCache);
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
}
/**
@@ -73,6 +88,7 @@ public class EditServiceValidator { // Test editing command...
SetRequest req = new SetRequest(editedEObject, editedFeature, semanticElement);
+ req.setParameter(RequestCacheEntries.Cache_Maps, adviceCache);
if ((editingService != null) && (editingService.canEdit(req))) {
return true;
}
|
