[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] [Solved] Layout information persistence

I have overriden the XXXMetamodelDiagramEditor.initializeGraphicalViewerContents() method to execute an auto-layout command and then the diagram file is saved:

Sample: @Override
protected void initializeGraphicalViewerContents() {
super.initializeGraphicalViewerContents();


ArrangeRequest arrangeRequest = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);
IGraphicalEditPart rootEP = (IGraphicalEditPart) getDiagramGraphicalViewer().getRootEditPart().getContents();
List l = new ArrayList();
l.add(rootEP);
arrangeRequest.setPartsToArrange(l);
Command cmd = rootEP.getCommand(arrangeRequest);
// execute command
getCommandStack().execute(cmd);


 // save the file
 performSave(true, new NullProgressMonitor());
}

After the auto-layout I can get all the tranformation relevant infromation!