|
Re: Generate Diagram from Domain model file [message #1062791 is a reply to message #1062338] |
Mon, 10 June 2013 18:21 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
You can register your diagram editor (as a non-default editor) for the
..x extension, and use the Open with-><your diagram editor> command for
opening it on a domain model data file. Then, in your persistency
behavior class you check if the editor input has the x extension, and in
that case create the diagram on the fly and pass is along. Here's a
sketch of the code:
public Diagram loadDiagram(URI uri) {
String fileExtension = uri.fileExtension();
if (fileExtension.equals("x")) {
uri = uri.trimFileExtension().appendFileExtension("newdiagram");
// a helper method that you must write,
// that typically is also part of a wizard
// it must create the diagram file that will be loaded
CreateActorDiagramWizard.createDiagramFile(uri, DIAGRAM_TYPE_ID);
}
return super.loadDiagram(uri);
}
On 07.06.13 02.31, Heeren Sharma wrote:
> Hello,
> I have separated the domain model data and diagram file data into two
> separate files. (as mentioned in FAQs). Lets say I have my model data in
> file extension .x (which is a a structured XML file)and my diagram data
> in .newdiagram file extensions. Now, I am able to generate every time
> the new diagram file and respective model file is also generated at the
> same time.
> But, I am wondering is it possible that I open the model file i.e.
> anyname.x file and generate equivalent diagram file i.e
> anyname.newdiagram file? Any suggestions in any direction will be helpful.
> Thanks,
> Heeren
|
|
|
Powered by
FUDForum. Page generated in 0.05012 seconds