Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Dahyabhai2019-04-22 21:38:40 +0000
committerNitin Dahyabhai2019-04-22 21:38:40 +0000
commit145d30ad6b8e46a708484f3e278cb42052e99e3e (patch)
tree747f16bd4567580e5fa4df90ccb8570e30c388ac
parent25b5f40c5beeeb9f587250fa804561e7ed238cd9 (diff)
downloadwebtools.sourceediting-145d30ad6b8e46a708484f3e278cb42052e99e3e.tar.gz
webtools.sourceediting-145d30ad6b8e46a708484f3e278cb42052e99e3e.tar.xz
webtools.sourceediting-145d30ad6b8e46a708484f3e278cb42052e99e3e.zip
[314480] properly dispose of providers when switching configurations
-rw-r--r--core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
index 03408d2ef4..c5503f1cd3 100644
--- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
+++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/quickoutline/QuickOutlinePopupDialog.java
@@ -22,6 +22,8 @@ import org.eclipse.jface.dialogs.PopupDialog;
import org.eclipse.jface.text.IInformationControl;
import org.eclipse.jface.text.IInformationControlExtension;
import org.eclipse.jface.text.IInformationControlExtension2;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -150,7 +152,12 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation
fTreeViewer = new TreeViewer(tree);
fTreeViewer.setContentProvider(fContentProvider);
- fTreeViewer.setLabelProvider(fLabelProvider);
+ if (fLabelProvider instanceof IStyledLabelProvider) {
+ new DelegatingStyledCellLabelProvider((IStyledLabelProvider) fLabelProvider);
+ }
+ else {
+ fTreeViewer.setLabelProvider(fLabelProvider);
+ }
fTreeViewer.setAutoExpandLevel(2);
fTreeViewer.setUseHashlookup(true);
fTreeViewer.setInput(fModel);
@@ -509,8 +516,17 @@ public class QuickOutlinePopupDialog extends PopupDialog implements IInformation
nextConfiguration = fFirstConfiguration;
}
if (fConfiguration != nextConfiguration) {
+ fContentProvider.dispose();
+ fLabelProvider.dispose();
+
fTreeViewer.setContentProvider(fContentProvider = nextConfiguration.getContentProvider());
- fTreeViewer.setLabelProvider(fLabelProvider = nextConfiguration.getLabelProvider());
+ fLabelProvider = nextConfiguration.getLabelProvider();
+ if (fLabelProvider instanceof IStyledLabelProvider) {
+ fTreeViewer.setLabelProvider(new DelegatingStyledCellLabelProvider((IStyledLabelProvider) fLabelProvider));
+ }
+ else {
+ fTreeViewer.setLabelProvider(fLabelProvider);
+ }
fSelectionProvider = nextConfiguration.getContentSelectionProvider();
fFilter = nextConfiguration.getFilter();
installFilter();

Back to the top