Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-06-02 19:41:39 +0000
committerChristian W. Damus2014-06-02 19:41:50 +0000
commit7ec45c332917dd5bbfbe537a166474b921d48c69 (patch)
treeb4c30d5ccbdf272769e14a0118a9e3f3b494fbc5 /plugins/views
parentb700c3e50de3db7d010921a8713efee73e8c2166 (diff)
downloadorg.eclipse.papyrus-7ec45c332917dd5bbfbe537a166474b921d48c69.tar.gz
org.eclipse.papyrus-7ec45c332917dd5bbfbe537a166474b921d48c69.tar.xz
org.eclipse.papyrus-7ec45c332917dd5bbfbe537a166474b921d48c69.zip
417409: [Performances - Properties view] Delay in UI when reorganizing diagram layout.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=417409 Ensure that when the user reconfigures the property sheet, the cache of XML UI definitions is purged so that any changes in presentation of the properties may be implemented.
Diffstat (limited to 'plugins/views')
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/DefaultDisplayEngine.java9
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java6
-rw-r--r--plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTTabDescriptorProvider.java20
3 files changed, 33 insertions, 2 deletions
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/DefaultDisplayEngine.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/DefaultDisplayEngine.java
index c057263f513..dc5360b25b5 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/DefaultDisplayEngine.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/DefaultDisplayEngine.java
@@ -138,6 +138,15 @@ public class DefaultDisplayEngine implements DisplayEngine {
public void dispose() {
disposeControls();
}
+
+ /**
+ * Invalidates any caches that I may have because the displayed property UI contexts, constraints, or views have
+ * changed in some way.
+ */
+ public void invalidate() {
+ // Forget the cached XML property definitions because they may have changed
+ xmlCache = null;
+ }
public Control createSection(Composite parent, Section section, DataSource source) {
if(source == null) {
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java
index 1dd6e927198..848803eae39 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/runtime/ViewConstraintEngineImpl.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 417409
+ *
*****************************************************************************/
package org.eclipse.papyrus.views.properties.runtime;
@@ -34,6 +36,8 @@ public class ViewConstraintEngineImpl extends DefaultConstraintEngine<View> impl
for(Context context : contexts) {
addContext(context);
}
+
+ fireConstraintsChanged();
}
public void addContext(final Context context) {
diff --git a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTTabDescriptorProvider.java b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTTabDescriptorProvider.java
index d2aa3ccc120..5ff47ffabdd 100644
--- a/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTTabDescriptorProvider.java
+++ b/plugins/views/properties/org.eclipse.papyrus.views.properties/src/org/eclipse/papyrus/views/properties/xwt/XWTTabDescriptorProvider.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
+ * Copyright (c) 2010, 2014 CEA LIST and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,8 @@
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ * Christian W. Damus (CEA) - bug 417409
+ *
*****************************************************************************/
package org.eclipse.papyrus.views.properties.xwt;
@@ -23,6 +25,8 @@ import java.util.Map;
import java.util.Set;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.papyrus.infra.constraints.runtime.ConstraintEngineListener;
+import org.eclipse.papyrus.infra.constraints.runtime.ConstraintsChangedEvent;
import org.eclipse.papyrus.views.properties.Activator;
import org.eclipse.papyrus.views.properties.contexts.View;
import org.eclipse.papyrus.views.properties.runtime.ConfigurationManager;
@@ -53,6 +57,20 @@ public class XWTTabDescriptorProvider implements ITabDescriptorProvider {
private final Map<IWorkbenchPart, DisplayEngine> displays = new HashMap<IWorkbenchPart, DisplayEngine>();
+
+ public XWTTabDescriptorProvider() {
+ ConfigurationManager.getInstance().getConstraintEngine().addConstraintEngineListener(new ConstraintEngineListener() {
+
+ public void constraintsChanged(ConstraintsChangedEvent event) {
+ // Purge the caches of all display engines because the XML view descriptions
+ // they cached are out of date
+ for(DisplayEngine next : displays.values()) {
+ ((DefaultDisplayEngine)next).invalidate();
+ }
+ }
+ });
+ }
+
private DisplayEngine getDisplay(final IWorkbenchPart part) {
if(!displays.containsKey(part)) {
displays.put(part, new DefaultDisplayEngine());

Back to the top