Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2013-09-30 19:42:58 +0000
committerGerrit Code Review @ Eclipse.org2013-10-04 15:22:28 +0000
commit8a91a5734559e43ea4dda308896eb8679e8c4ec8 (patch)
treeda1cbe71aea712e8eec284d27793a0b5f183901b
parente361bf50db2afd28daa2f3a5e13042ba1cc2eb53 (diff)
downloadeclipse.platform.ui-8a91a5734559e43ea4dda308896eb8679e8c4ec8.tar.gz
eclipse.platform.ui-8a91a5734559e43ea4dda308896eb8679e8c4ec8.tar.xz
eclipse.platform.ui-8a91a5734559e43ea4dda308896eb8679e8c4ec8.zip
Bug 416099 - [Workbench] Simplify SaveAllHandler
Change-Id: I325adcb2851aaecb9759d4f4c40169ae64dc3a43 Signed-off-by: Lars Vogel <Lars.Vogel@gmail.com>
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveAllHandler.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveAllHandler.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveAllHandler.java
index 4e667434bbd..0e2ac3ec8cf 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveAllHandler.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/handlers/SaveAllHandler.java
@@ -7,28 +7,21 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Lars Vogel (Lars.Vogel@gmail.com) - Bug 416099
******************************************************************************/
package org.eclipse.e4.ui.internal.workbench.handlers;
-import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
-import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
public class SaveAllHandler {
@CanExecute
- boolean canExecute(@Optional MWindow window) {
- if (window != null) {
- IEclipseContext context = window.getContext();
- if (context != null) {
- EPartService partService = context.get(EPartService.class);
- if (partService != null) {
- return !partService.getDirtyParts().isEmpty();
- }
- }
+ boolean canExecute(@Optional EPartService partService) {
+ if (partService != null) {
+ return !partService.getDirtyParts().isEmpty();
}
return false;
}

Back to the top