aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Elder2014-02-18 14:51:23 (EST)
committerGerrit Code Review @ Eclipse.org2014-02-20 05:25:26 (EST)
commitc72486264793cf734d7e2c74302cf0ff06f64635 (patch)
tree78f89dd8ee528ba7af31ea0d059f67095abf16d5
parent6ed91ab2e54702d3082c83d3fb14e00e51d9cb2e (diff)
downloadeclipse.platform.ui-c72486264793cf734d7e2c74302cf0ff06f64635.zip
eclipse.platform.ui-c72486264793cf734d7e2c74302cf0ff06f64635.tar.gz
eclipse.platform.ui-c72486264793cf734d7e2c74302cf0ff06f64635.tar.bz2
bug 421170: DEL from within the Ctrl + E popup saves dirty editorsrefs/changes/83/22183/2
without prompting Guard against editor list popup disposal as a result showing a save dialog. Change-Id: I0a6e1a033ee6bf6e6894256ef975834ec9f6de0e
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java
index 8d0743c..1be850d 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/internal/workbench/renderers/swt/BasicPartList.java
@@ -111,6 +111,8 @@ public class BasicPartList extends AbstractTableInformationControl {
private StackRenderer renderer;
+ // private ISaveHandler saveHandler;
+
public BasicPartList(Shell parent, int shellStyle, int treeStyler,
EPartService partService, MElementContainer<?> input,
StackRenderer renderer, ISWTResourceUtilities utils,
@@ -120,6 +122,7 @@ public class BasicPartList extends AbstractTableInformationControl {
this.input = input;
this.renderer = renderer;
this.utils = utils;
+ // this.saveHandler = saveHandler;
if (alphabetical && getTableViewer() != null) {
getTableViewer().setComparator(new ViewerComparator());
}
@@ -194,9 +197,16 @@ public class BasicPartList extends AbstractTableInformationControl {
protected boolean deleteSelectedElements() {
Object selectedElement = getSelectedElement();
if (selectedElement != null) {
- if (partService.savePart((MPart) selectedElement, false))
+ if (partService.savePart((MPart) selectedElement, true))
partService.hidePart((MPart) selectedElement);
+ if (getShell() == null) {
+ // Bug 421170: Contract says to return true if there are no
+ // elements left. In this case, there is no shell left because
+ // we popped a save dialog and auto-closed the list. Ergo, there
+ // are no elements left.
+ return true;
+ }
if (getInput().isEmpty()) {
getShell().dispose();
return true;