aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2013-09-30 15:42:58 (EDT)
committerGerrit Code Review @ Eclipse.org2013-10-04 11:22:28 (EDT)
commit8a91a5734559e43ea4dda308896eb8679e8c4ec8 (patch)
treeda1cbe71aea712e8eec284d27793a0b5f183901b
parente361bf50db2afd28daa2f3a5e13042ba1cc2eb53 (diff)
downloadeclipse.platform.ui-8a91a5734559e43ea4dda308896eb8679e8c4ec8.zip
eclipse.platform.ui-8a91a5734559e43ea4dda308896eb8679e8c4ec8.tar.gz
eclipse.platform.ui-8a91a5734559e43ea4dda308896eb8679e8c4ec8.tar.bz2
Bug 416099 - [Workbench] Simplify SaveAllHandler refs/changes/97/16897/3
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 4e66743..0e2ac3e 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;
}