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