Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358822 - Editor incorrectly marked as dirty after save in different Graphiti-editor
Summary: Editor incorrectly marked as dirty after save in different Graphiti-editor
Status: CLOSED DUPLICATE of bug 356218
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-25 11:09 EDT by Ivar Refsdal CLA
Modified: 2011-09-30 05:02 EDT (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 Ivar Refsdal CLA 2011-09-25 11:09:40 EDT
Build Identifier: 

The editor is incorrectly marked as dirty after save.

A recipie for copying object between diagrams would be appreciated as well:
The following does this, but with the incorrect dirty mark.
public void paste(IPasteContext context) {
		// we already verified, that we paste directly in the diagram
		PictogramElement[] pes = context.getPictogramElements();
		Diagram diagram = (Diagram) pes[0];
		// get the EClasses from the clipboard without copying them
		// (only copy the pictogram element, not the business object)
		// then create new pictogram elements using the add feature
		Object[] objects = getFromClipboard();
		for (Object object : objects) {
			if (object instanceof EObject) {
				EObject eObject = (EObject) object;
				eObject = EcoreUtil.copy(eObject);
				AddContext ac = new AddContext();
				ac.setLocation(0, 0); // for simplicity paste at (0, 0)
				ac.setTargetContainer(diagram);
				addGraphicalRepresentation(ac, eObject);
			}
		}
	}

Reproducible: Always

Steps to Reproduce:
0. Modify the tutorial paste feature like this, so no changes are made:
	public void paste(IPasteContext context) {
		// we already verified, that we paste directly in the diagram
		PictogramElement[] pes = context.getPictogramElements();
		Diagram diagram = (Diagram) pes[0];
		// get the EClasses from the clipboard without copying them
		// (only copy the pictogram element, not the business object)
		// then create new pictogram elements using the add feature
                return;
}
1. Create two diagrams, newDiagram1 and newDiagram2, using the tutorial wizard.
2. Create a new class in newDiagram1.
3. Copy it.
4. Paste it in newDiagram2. This should do nothing.
5. Save newDiagram2.
6. Go to newDiagram1.

Bug: 7. newDiagram1 is now marked as dirty.
Comment 1 Ivar Refsdal CLA 2011-09-26 05:00:02 EDT
Forgot one detail for reproducing:
2. Create a new class in newDiagram1. Save newDiagram1.
Comment 2 Ivar Refsdal CLA 2011-09-26 05:02:35 EDT
More details about installation:
  Graphiti SDK Plus (Incubation)	0.8.1.v20110912-1027	org.eclipse.graphiti.sdk.plus.feature.feature.group	Eclipse Modeling Project
Eclipse Platform Version: 3.7.1
Build id: M20110909-1335
Unable to select 0.8.1 as version in the above form.
Comment 3 Michael Wenz CLA 2011-09-30 05:02:10 EDT
This was caused by a bug in the DefaultDiagramUpdateFeature and has been fixed for Juno M2 along with https://bugs.eclipse.org/bugs/show_bug.cgi?id=356218

*** This bug has been marked as a duplicate of bug 356218 ***