Reputation: 1351
I am using java SWT for an application development.
There is a SWT Tree with some child nodes in the tool and I want to delete some of them. I tried using remove() and removeAll() methods but it does not delete the item completely. It leaves behind a space for TreeItem.
Upvotes: 2
Views: 2540
Reputation: 2311
TreeItem
is a descendant of Widget
which contains the dispose() method. According to documentation:
Disposes of the operating system resources associated with the receiver and all its descendants. After this method has been invoked, the receiver and all descendants will answer true when sent the message isDisposed(). Any internal connections between the widgets in the tree will have been removed to facilitate garbage collection. This method does nothing if the widget is already disposed.
So treeItem.dispose()
will work.
Upvotes: 5