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

Bug 329523

Summary: Extend IDiagramTypeProvider with resourceStored() method
Product: [Modeling] Graphiti Reporter: sergej shafarenka <beworker>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: juergen.pasch, michael.wenz, tim.kaiser
Version: 0.7.0Flags: michael.wenz: indigo+
juergen.pasch: iplog+
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
Whiteboard: Indigo M6 theme_round_offs

Description sergej shafarenka CLA 2010-11-05 06:00:08 EDT
Build Identifier: 

There is already IDiagramTypeProvider.resourceReloaded(Diagram diagram) method. I propose to add another method called resourceStored(). It should be called immediately after Diagram instance gets stored to the file system. This change will make API symmetric and will enable user to store their custom model separately from Diagram model but at the same time when Diagram gets stored.

I modified DiagramEditorInternal.doSave() method as shown below
@Override
public void doSave(IProgressMonitor monitor) {
	getBehavior().doSave(monitor);
	commandStackChanged(null);
	
	IDiagramTypeProvider provider = getConfigurationProvider().getDiagramTypeProvider();		
	provider.resourceStored();
}

and tested this change. It worked just perfectly.

Thanks and best regards,
Sergej

Reproducible: Always

Steps to Reproduce:
NA
Comment 1 Michael Wenz CLA 2010-11-05 08:04:30 EDT
The same can already be achieved by overriding doSave() in DiagramEditor (part of API). Besides convenience, do you see further benefits by introducing this?

The reload hook exists because there is no public API hook in the editor to get notified about that event.

Michael
Comment 2 sergej shafarenka CLA 2010-11-05 08:31:48 EDT
Maybe you are right. The only reason for me would be keeping business model handling at one place - in DiagramTypeProvider. As I didn't implement DiagramEditor but used one from graphiti.examples that we the only acceptable way to store my business model after diagram is stored.

Maybe I can answer this question in more details once I'm done with own editor.

Best regards,
Sergej
Comment 3 Michael Wenz CLA 2011-02-10 04:21:12 EST
I have added a resourcesSaved method to the AbstractDiagramTypeProvider and its interface. This methods gets called after saving a diagram and gets the affected diagram and the saved resources passed as parameters. Just checked in to head.

Michael
Comment 4 Juergen Pasch CLA 2011-04-15 03:33:46 EDT
Mark as iplog relevant.
Comment 5 Michael Wenz CLA 2011-06-24 09:10:01 EDT
Part of Graphiti Indigo 0.8.0