Put Eclipse and JCR components in subdirs in order to clarify indirect
[lgpl/argeo-commons.git] / org.argeo.cms.e4 / src / org / argeo / cms / e4 / handlers / CloseAllParts.java
diff --git a/org.argeo.cms.e4/src/org/argeo/cms/e4/handlers/CloseAllParts.java b/org.argeo.cms.e4/src/org/argeo/cms/e4/handlers/CloseAllParts.java
deleted file mode 100644 (file)
index d11c041..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.argeo.cms.e4.handlers;
-
-import org.eclipse.e4.core.di.annotations.CanExecute;
-import org.eclipse.e4.core.di.annotations.Execute;
-import org.eclipse.e4.ui.model.application.ui.basic.MPart;
-import org.eclipse.e4.ui.workbench.modeling.EPartService;
-
-public class CloseAllParts {
-
-       @Execute
-       void execute(EPartService partService) {
-               for (MPart part : partService.getParts()) {
-                       if (part.isCloseable()) {
-                               if (part.isDirty()) {
-                                       if (partService.savePart(part, true)) {
-                                               partService.hidePart(part, true);
-                                       }
-                               } else {
-                                       partService.hidePart(part, true);
-                               }
-                       }
-               }
-       }
-
-       @CanExecute
-       boolean canExecute(EPartService partService) {
-               boolean atLeastOnePart = false;
-               for (MPart part : partService.getParts()) {
-                       if (part.isVisible() && part.isCloseable()) {
-                               atLeastOnePart = true;
-                               break;
-                       }
-               }
-               return atLeastOnePart;
-       }
-
-}
\ No newline at end of file