|What is the best code practice to modify the domain model on diagram loading? [message #1046829]
||Mon, 22 April 2013 12:38
| Vitaly Savickas
Registered: March 2010
Can anyone suggest what is the best coding practice to modify the domain model when loading a diagram file?
I am interested in a scenario where some attributes of node elements need to be set as the diagram is opened. In my case there are non-transient attributes, which represent a file path to a resource. When a diagram is opened I need to load those resources for each of the nodes and set another attribute if loading succeeded.
From what I can see the generated diagram code does the whole loading process in a single call to
in the body of a
DiagramIOUtil.load(domain, storage, true, getProgressMonitor())
method, suggesting that I can customise the loaded document at that point. However, I try to avoid code customisation and separate the generated code from my code. Is there a better solution?
XXXDocumentProvider::setDocumentContent(IDocument document, IEditorInput element)
P.S. It is important that the diagram should not be marked as modified after this process.
Powered by FUDForum
. Page generated in 0.02021 seconds