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

Bug 348751

Summary: Diagram connection labels should check for derived and readonly properties
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: konstantin, shenxue.zhou
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch v1 none

Description Greg Amerson CLA 2011-06-08 10:23:01 EDT
Suppose that you specify a property for a diagram connection label that is @DerivedValue or @ReadOnly.  In the diagram editor, the connection label always allows editing however, in the case of DerivedValue or ReadOnly this operation will fail with an exception like below:

!ENTRY org.eclipse.graphiti.ui 4 0 2011-06-08 00:42:41.859
!MESSAGE GFCommandStack.execute(Command) java.lang.IllegalArgumentException: Cannot write property Label.
!STACK 0
java.lang.IllegalArgumentException: Cannot write property Label.
	at org.eclipse.sapphire.modeling.ModelElement.write(ModelElement.java:408)
	at com.liferay.ide.eclipse.service.core.model.internal.Relationship.write(Relationship.java:243)
	at org.eclipse.sapphire.ui.diagram.editor.DiagramConnectionPart.setLabel(DiagramConnectionPart.java:230)
	at org.eclipse.sapphire.ui.swt.graphiti.features.SapphireDirectEditConnectionFeature.setValue(SapphireDirectEditConnectionFeature.java:71)
	at org.eclipse.graphiti.internal.command.DirectEditingFeatureCommandWithContext.execute(DirectEditingFeatureCommandWithContext.java:81)
	at org.eclipse.graphiti.ui.internal.command.GefCommandWrapper.execute(GefCommandWrapper.java:51)
	at org.eclipse.graphiti.ui.internal.editor.EmfOnGefCommand.execute(EmfOnGefCommand.java:59)
	at org.eclipse.graphiti.internal.command.GFPreparableCommand2.doExecute(GFPreparableCommand2.java:37)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
Comment 1 Konstantin Komissarchik CLA 2011-06-08 11:19:45 EDT
Created attachment 197615 [details]
Patch v1
Comment 2 Konstantin Komissarchik CLA 2011-06-08 11:20:57 EDT
Issue fixed. Greg, please verify. Shenxue, please code review.
Comment 3 Shenxue Zhou CLA 2011-06-08 11:27:32 EDT
The patch looks good. Thanks!
Comment 4 Greg Amerson CLA 2011-06-08 11:38:25 EDT
Pulled this update via CVS and verified in my dev environment.
Comment 5 Konstantin Komissarchik CLA 2011-06-08 11:42:50 EDT
Closing.