Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuai Li2016-05-30 09:50:34 +0000
committerGerrit Code Review @ Eclipse.org2016-05-30 11:09:30 +0000
commit630e72844ea911281736f420d5064ec55fa37f63 (patch)
tree1e7c0f1f921b7c6070ae3815d37085e32e82fb66 /plugins/uml
parent30de6ff4a0c63639177ac46873e0742e90595229 (diff)
downloadorg.eclipse.papyrus-630e72844ea911281736f420d5064ec55fa37f63.tar.gz
org.eclipse.papyrus-630e72844ea911281736f420d5064ec55fa37f63.tar.xz
org.eclipse.papyrus-630e72844ea911281736f420d5064ec55fa37f63.zip
Bug 494738 - [Test Failure] StackOverFlow in canonical test caused by
ShortCutPreviewEditPolicy - Move the loading of the diagram preview to mousehover instead of activate Change-Id: I54ea2ea2b5608d09f3f9533028550dfd7188f1e2 Signed-off-by: Shuai Li <shuai.li@cea.fr>
Diffstat (limited to 'plugins/uml')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutPreviewEditPolicy.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutPreviewEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutPreviewEditPolicy.java
index 91c2d1bf43a..6ba9db34e41 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutPreviewEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutPreviewEditPolicy.java
@@ -58,12 +58,6 @@ public class ShortCutPreviewEditPolicy extends PapyrusPopupBarEditPolicy {
&& ((GraphicalEditPart) getHost()).getNotationView().getElement() instanceof Diagram) {
diagram = (Diagram) ((GraphicalEditPart) getHost()).getNotationView().getElement();
}
-
- try {
- previewImage = DiagramRenderUtil.renderToSWTImage(diagram);
- } catch(Exception e) {
- Activator.log.error(e);
- }
}
}
@@ -79,6 +73,21 @@ public class ShortCutPreviewEditPolicy extends PapyrusPopupBarEditPolicy {
}
}
+ /**
+ * Loads the preview
+ */
+ @Override
+ public void mouseHover(MouseEvent me) {
+ if (diagram != null) {
+ try {
+ previewImage = DiagramRenderUtil.renderToSWTImage(diagram);
+ } catch(Exception e) {
+ Activator.log.error(e);
+ }
+ super.mouseHover(me);
+ }
+ }
+
@Override
protected void showDiagramAssistant(Point referencePoint) {
if (diagram != null && previewImage != null) { // In case activation failed

Back to the top