diff options
author | Darin Wright | 2009-12-01 14:49:25 +0000 |
---|---|---|
committer | Darin Wright | 2009-12-01 14:49:25 +0000 |
commit | 5ee31ed55ca0a3720552e04ab1091e460a20507f (patch) | |
tree | 1346d569fae7b24219baf0e7feda175fdf42ad7d /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model | |
parent | cb9aca189d297be5daf45960bf9bc29527687b33 (diff) | |
download | eclipse.platform.debug-5ee31ed55ca0a3720552e04ab1091e460a20507f.tar.gz eclipse.platform.debug-5ee31ed55ca0a3720552e04ab1091e460a20507f.tar.xz eclipse.platform.debug-5ee31ed55ca0a3720552e04ab1091e460a20507f.zip |
Bug 295771 - [flex-hierarchy] IPresentationContext should be disposed by its creator.
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model')
4 files changed, 17 insertions, 19 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java index d25db71ef..670355541 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java @@ -165,16 +165,6 @@ public class InternalTreeModelViewer extends TreeViewer private boolean fNotifyUnmap = true; /** - * Flag indicating whether the viewer is a pop-up viewer. A pop-up viewer - * is transient and does not automatically expand and select elements up - * when requested by the model. It also does not dispose the presentation - * context when its control is disposed. - * - * @since 3.5 - */ - private boolean fIsPopup; - - /** * Persist column sizes when they change. * * @since 3.2 @@ -1019,8 +1009,9 @@ public class InternalTreeModelViewer extends TreeViewer setContentProvider(createContentProvider()); setLabelProvider(createLabelProvider()); - fIsPopup = (style & SWT.POP_UP) != 0; - if (fIsPopup) { + // A pop-up viewer is transient and does not automatically expand + // and select elements up when requested by the model + if ((style & SWT.POP_UP) != 0) { ((ITreeModelContentProvider)getContentProvider()).setModelDeltaMask( ~ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS & ~ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS); } @@ -1138,9 +1129,6 @@ public class InternalTreeModelViewer extends TreeViewer } fCellModifier.dispose(); - if (!fIsPopup) { - fContext.dispose(); - } super.handleDispose(event); } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java index c0c229bed..8dfc928da 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java @@ -951,7 +951,6 @@ public class InternalVirtualTreeModelViewer extends Viewer if (fColumnPresentation != null) { fColumnPresentation.dispose(); } - fContext.dispose(); if (fContentProvider != null) { fContentProvider.dispose(); diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java index 780d18a6e..f8ef91019 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/IPresentationContext.java @@ -22,13 +22,23 @@ import org.eclipse.jface.util.IPropertyChangeListener; * @since 3.2 */ public interface IPresentationContext { - + /** * Property name used for property change notification when the columns * in a presentation context change. */ public static final String PROPERTY_COLUMNS = "PROPERTY_COLUMNS"; //$NON-NLS-1$ - + + /** + * Property indicating whether the presentation context is disposed. + * It is set to <code>Boolean.TRUE</code> after the presentation context + * is disposed. This property may be <code>null</code>, which indicates + * that context is not yet disposed. + * + * @since 3.6 + */ + public static final String PROPERTY_DISPOSED = "PROPERTY_DISPOSED"; //$NON-NLS-1$ + /** * Returns identifiers of the visible columns in the order * labels should be provided, or <code>null</code> if columns diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java index 22c752441..b79b67859 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java @@ -98,8 +98,9 @@ public class PresentationContext implements IPresentationContext { * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#dispose() */ public void dispose() { + fProperties.clear(); + setProperty(PROPERTY_DISPOSED, Boolean.TRUE); fListeners.clear(); - fProperties.clear(); } /* (non-Javadoc) |