Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Custom Save
Custom Save [message #1002287] Fri, 18 January 2013 10:17 Go to next message
Lars Schulte is currently offline Lars SchulteFriend
Messages: 4
Registered: December 2012
Junior Member

is it possible to change the save behavior of Graphiti? As far as I can tell Graphiti saves its diagram as an xmi file. Thats fine so far, but what im looking for is the possibility to save several diagrams into a single xmi file.
Any ideas?

Re: Custom Save [message #1002329 is a reply to message #1002287] Fri, 18 January 2013 12:11 Go to previous message
Aljoscha Hark is currently offline Aljoscha HarkFriend
Messages: 24
Registered: March 2012
Junior Member

you can do it easily:

- when doing it from within an already opened diagram, just do it by
Diagram diagram1 = ...; // the already opened diagram
Diagram diagram2 = ...; // the additional diagram
diagram1.eResource().getContents().add(diagram2); // do it inside a feature/write transaction

- when doing it "on load", e.g. from a context menu handler on a file
Diagram diagram = ...; // the additional diagram

String path = "/project/file.diagrams";
ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.getResource(URI.createPlatformResource(path, true));
try {;
} catch(IOException e) {
   // e.g. log error

Previous Topic:new Diagram
Next Topic:Adding Root Domain Object on Diagram Creation
Goto Forum:

Current Time: Thu Nov 26 10:54:15 GMT 2015

Powered by FUDForum. Page generated in 0.01609 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software