summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorPaul Elder2013-01-24 11:58:19 (EST)
committer Dani Megert2013-01-25 05:10:33 (EST)
commit3159984032ae4af0d8d6e76dbc01d0df21f41ef6 (patch)
treede6f800e59627d109b85043b48b8db26e4e6a0c1
parente5011f98cb5b5665aa399edede2b2cd949f97b06 (diff)
downloadeclipse.platform.ui-3159984032ae4af0d8d6e76dbc01d0df21f41ef6.zip
eclipse.platform.ui-3159984032ae4af0d8d6e76dbc01d0df21f41ef6.tar.gz
eclipse.platform.ui-3159984032ae4af0d8d6e76dbc01d0df21f41ef6.tar.bz2
Bug 388516 - Regression: Never ending exceptions after closing all
perspectives and restarting
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java17
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java2
2 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
index 4606072..b6d2319 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/HandledContributionItem.java
@@ -118,6 +118,7 @@ public class HandledContributionItem extends ContributionItem {
List<HandledContributionItem> itemsToCheck = new ArrayList<HandledContributionItem>();
List<Runnable> windowRunnables = new ArrayList<Runnable>();
+ final List<HandledContributionItem> orphanedToolItems = new ArrayList<HandledContributionItem>();
public void addWindowRunnable(Runnable r) {
windowRunnables.add(r);
@@ -142,8 +143,18 @@ public class HandledContributionItem extends ContributionItem {
}
public void run() {
- for (HandledContributionItem hci : itemsToCheck) {
- hci.updateItemEnablement();
+
+ for (final HandledContributionItem hci : itemsToCheck) {
+ // HACK. Remove orphaned entries. See bug 388516.
+ if (hci.model != null && hci.model.getParent() != null) {
+ hci.updateItemEnablement();
+ } else {
+ orphanedToolItems.add(hci);
+ }
+ }
+ if (!orphanedToolItems.isEmpty()) {
+ itemsToCheck.removeAll(orphanedToolItems);
+ orphanedToolItems.clear();
}
Runnable[] array = new Runnable[windowRunnables.size()];
@@ -879,4 +890,4 @@ public class HandledContributionItem extends ContributionItem {
public Widget getWidget() {
return widget;
}
-} \ No newline at end of file
+}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java
index d20dc13..53cc3e7 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/quickaccess/SearchField.java
@@ -118,7 +118,7 @@ public class SearchField {
}
private void closeDropDown() {
- if (shell.isDisposed() || text.isDisposed() || !shell.isVisible())
+ if (shell == null || shell.isDisposed() || text.isDisposed() || !shell.isVisible())
return;
quickAccessContents.doClose();