Skip to content

Commit 32a019a

Browse files
committed
[Eclipse4ModelPersistence] Added addtional inline comment
Change-Id: I0110b0da0e8365da7191af2630e6ba259fc32249 Signed-off-by: Simon Scholz <simon.scholz@vogella.com>
1 parent 3894d52 commit 32a019a

File tree

1 file changed

+6
-4
lines changed
  • com.vogella.e4.model.persistence/src/com/vogella/e4/model/persistence/handlers

1 file changed

+6
-4
lines changed

com.vogella.e4.model.persistence/src/com/vogella/e4/model/persistence/handlers/SaveHandler.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@ public void execute(EModelService modelService, MWindow window) {
2424
E4XMIResourceFactory e4xmiResourceFactory = new E4XMIResourceFactory();
2525
Resource resource = e4xmiResourceFactory.createResource(null);
2626

27-
// You must clone the perspective as snippet, otherwise the running application would break
27+
// You must clone the perspective as snippet, otherwise the running
28+
// application would break, because the saving process of the resource
29+
// removes the element from the running application model
2830
MUIElement clonedPerspective = modelService.cloneElement(activePerspective, window);
29-
31+
3032
// add the cloned model element to the resource so that it may be stored
3133
resource.getContents().add((EObject) clonedPerspective);
32-
34+
3335
FileOutputStream outputStream = null;
3436
try {
35-
37+
3638
// Use a stream to save the model element
3739
outputStream = new FileOutputStream("/home/simon/simon.xmi");
3840

0 commit comments

Comments
 (0)