Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 403377

Summary: OrderedLayoutEditPolicy.isLayoutHorizontal() throws ClassCastException
Product: [Tools] GEF Reporter: Adrian Price <adrianp.quatinus>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3 CC: nyssen
Version: 3.7.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Adrian Price CLA 2013-03-14 13:39:07 EDT
Noted in org.eclipse.gef_3.7.2.v20110927-2020-777D381B4Bz0755B465D34242

At OrderedLayoutEditPolicy.java line 147, figure.getLayoutManager() returned an org.eclipse.draw2d.StackLayout, which cannot be cast to org.eclipse.draw2d.OrderedLayout

Stack trace from debugger:
Thread [main] (Suspended (exception ClassCastException))
	PaneLayoutEditPolicy(OrderedLayoutEditPolicy).isLayoutHorizontal() line: 147
	PaneLayoutEditPolicy(FlowLayoutEditPolicy).getFeedbackIndexFor(Request) line: 65
	PaneLayoutEditPolicy(FlowLayoutEditPolicy).getInsertionReference(Request) line: 125
	PaneLayoutEditPolicy(ElementLayoutEditPolicy).getCreateCommand(CreateRequest) line: 440
	PaneLayoutEditPolicy(LayoutEditPolicy).getCommand(Request) line: 228
	PaneLayoutEditPolicy(ElementLayoutEditPolicy).getCommand(Request) line: 415
	PaneEditPart(AbstractEditPart).getCommand(Request) line: 500
	SourceFeedbackCreationTool(TargetingTool).getCommand() line: 123
	SourceFeedbackCreationTool(CreationTool).handleMove() line: 253
	SourceFeedbackCreationTool.handleMove() line: 153
	SourceFeedbackCreationTool(AbstractTool).mouseMove(MouseEvent, EditPartViewer) line: 1182
	DefaultEditDomain(EditDomain).mouseMove(MouseEvent, EditPartViewer) line: 287
	QuickFixToolTipEnabledDomainEventDispatcher(DomainEventDispatcher).dispatchMouseMoved(MouseEvent) line: 365
	LightweightSystem$EventHandler.mouseMove(MouseEvent) line: 543
	TypedListener.handleEvent(Event) line: 211
	EventTable.sendEvent(Event) line: 84
	FigureCanvas(Widget).sendEvent(Event) line: 1053
Comment 1 Alexander Nyßen CLA 2013-09-30 15:01:44 EDT
OrderedLayoutEditPolicy may only be applied if the layout container (by default the content pane of the host edit part) is an OrderedLayout, and StackLayout is not. As such, this is an invalid use case.