Skip to content

Commit

Permalink
Disposing the editor in tree viewer.
Browse files Browse the repository at this point in the history
Fix : #649
  • Loading branch information
Dinesh0723 authored and gireeshpunathil committed Nov 30, 2023
1 parent 7cabdd8 commit fc8ce0b
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.window.Window;
Expand Down Expand Up @@ -846,6 +845,7 @@ public void initializeFrom(ILaunchConfiguration config, boolean enableTable) thr
fPluginFilteredTree.getPatternFilter().setPattern(null);
if (!enableTable) {
fPluginTreeViewer.setInput(null);
refreshTreeView(fPluginTreeViewer);
} else if (fPluginTreeViewer.getInput() == null) {
fPluginTreeViewer.setUseHashlookup(true);
fPluginTreeViewer.setInput(PDEPlugin.getDefault());
Expand Down Expand Up @@ -1077,21 +1077,10 @@ protected void setVisible(boolean visible) {
protected abstract LaunchValidationOperation createValidationOperation() throws CoreException;

/**
* called before the TreeView is refreshed. This allows any subclasses to cache
* any information in the view and redisplay after the refresh. This is used by the
* OSGiBundleBlock to cache the values of the default launch and auto launch columns
* in the table tree.
* Disposing the editor in tree viewer
*
* @param treeView The tree view that will be refreshed.
*/
protected void refreshTreeView(CheckboxTreeViewer treeView) {
// Remove any selection
if (treeView.getTree().getItemCount() > 0) {
treeView.getTree().setSelection(treeView.getTree().getItem(0));
} else {
treeView.setSelection(new StructuredSelection(StructuredSelection.EMPTY));
}

// Reset any editors on the tree viewer
if (levelColumnEditor != null && levelColumnEditor.getEditor() != null && !levelColumnEditor.getEditor().isDisposed()) {
levelColumnEditor.getEditor().dispose();
Expand Down

0 comments on commit fc8ce0b

Please sign in to comment.