e662d6b893d5b35b57b6d455f7b176c6b759f984
[Mograsim.git] / net.mograsim.rcp / src / net / mograsim / rcp / handlers / SaveHandler.java
1 package net.mograsim.rcp.handlers;
2
3 import org.eclipse.e4.core.di.annotations.CanExecute;
4 import org.eclipse.e4.core.di.annotations.Execute;
5 import org.eclipse.e4.ui.workbench.modeling.EPartService;
6
7 public class SaveHandler
8 {
9
10         @CanExecute
11         public boolean canExecute(EPartService partService)
12         {
13                 if (partService != null)
14                 {
15                         return !partService.getDirtyParts().isEmpty();
16                 }
17                 return false;
18         }
19
20         @Execute
21         public void execute(EPartService partService)
22         {
23                 partService.saveAll(false);
24         }
25 }