Bug 140186 - XYLayoutEditPolicy should not be installed for editparts that have figure with non-XYLayout in the gmfgraph model
Summary: XYLayoutEditPolicy should not be installed for editparts that have figure wit...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Tooling (ARCHIVED)
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael Golubev CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-05-04 12:04 EDT by Michael Golubev CLA
Modified: 2010-07-19 22:17 EDT (History)
0 users

See Also:


Attachments
Fixes the subj (140.12 KB, patch)
2006-05-16 13:48 EDT, Michael Golubev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Golubev CLA 2006-05-04 12:04:44 EDT
Inspired by the news-group thread started at the news:e374cq$pbd$1@utils.eclipse.org. Complete steps to reproduce are at the news:e37v36$3tv$1@utils.eclipse.org

Actually if gmgraph node points to the figure with some layout other than XYlayout, and the corresponding GenNode has listLayout = false, generated code installs XYLayoutEditpolicy to the parent edit part. 
In this case, attempt to create child in this node fails with following exception: 

java.lang.ClassCastException: org.eclipse.draw2d.ToolbarLayout
	at org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getXYLayout(XYLayoutEditPolicy.java:131)
	at org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getLayoutOrigin(XYLayoutEditPolicy.java:110)
	at org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.getConstraintFor(ConstrainedLayoutEditPolicy.java:209)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy.getConstraintFor(XYLayoutEditPolicy.java:336)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy.getCreateCommand(XYLayoutEditPolicy.java:256)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy.getCommand(XYLayoutEditPolicy.java:321)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:470)

Expected: It should be possible to create child node. To achive this, do not install XYLayoutEditPolicy for such cases.
Comment 1 Michael Golubev CLA 2006-05-16 13:48:34 EDT
Created attachment 41616 [details]
Fixes the subj

Property isListLayout now is applicable only to GenCompartment's.
For GenNode's the editpolicies, applicable notation styles, etc is determined from gnfgraph layout for node figure. 
To achive this without adding dependency gmfgen -> gmfgraph, the kind of used figure's (that is, viewmap's) layout is provided to gmfgen as Viewmap#layoutType property.
Comment 2 Artem Tikhomirov CLA 2006-05-17 09:52:34 EDT
Reviewed and committed
Comment 3 Eclipse Webmaster CLA 2010-07-19 22:17:46 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Generation was the original product and component for this bug