Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329523 - Extend IDiagramTypeProvider with resourceStored() method
Summary: Extend IDiagramTypeProvider with resourceStored() method
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 0.8.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: Indigo M6 theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 06:00 EDT by sergej shafarenka CLA
Modified: 2011-06-24 09:10 EDT (History)
3 users (show)

See Also:
michael.wenz: indigo+
juergen.pasch: iplog+


Attachments

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