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

Bug 348675

Summary: Diagram node show-in-source action handler needs a condition associated
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: konstantin
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Greg Amerson CLA 2011-06-08 00:07:54 EDT
It looks like diagram node’s show-in-source action handler doesn’t have a condition associated with it to see if there is source to be shown. We need something like OutlineNodeShowInSourceActionHandlerCondition for the content outline node show-in-source. 

If you have a diagram node that is not backed by an XmlResource, it will throw a CCE when you try to execute the action.

java.lang.ClassCastException: com.liferay.ide.eclipse.service.core.model.internal.RelationshipResource cannot be cast to org.eclipse.sapphire.modeling.xml.XmlResource
	at org.eclipse.sapphire.ui.swt.xml.editor.XmlEditorResourceStore$XmlSourceEditorService.show(XmlEditorResourceStore.java:583)
	at org.eclipse.sapphire.ui.diagram.actions.DiagramShowInSourceActionHandler.run(DiagramShowInSourceActionHandler.java:39)
	at org.eclipse.sapphire.ui.SapphireActionHandler.execute(SapphireActionHandler.java:89)
	at org.eclipse.sapphire.ui.swt.graphiti.actions.SapphireActionHandlerDelegate.run(SapphireActionHandlerDelegate.java:70)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
Comment 1 Konstantin Komissarchik CLA 2011-06-08 17:34:31 EDT
Fixed. Please verify.
Comment 2 Greg Amerson CLA 2011-06-08 18:04:23 EDT
Verified, very nice.
Comment 3 Konstantin Komissarchik CLA 2011-06-08 18:08:31 EDT
Closing.