Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348675 - Diagram node show-in-source action handler needs a condition associated
Summary: Diagram node show-in-source action handler needs a condition associated
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 00:07 EDT by Greg Amerson CLA
Modified: 2021-11-19 09:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.