Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 216209

Summary: API Consistency with Tree for remove/clear
Product: z_Archived Reporter: Peter Centgraf <peter>
Component: NebulaAssignee: Nicolas Richeton <nicolas.richeton>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P1 Keywords: plan
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Peter Centgraf CLA 2008-01-22 18:30:14 EST
There is an inconsistency between the GalleryItem API and the TreeItem API for the remove/clear functionality.  TreeItem has a removeAll() method, but there is no remove(TreeItem) or remove(int).  Instead, you must call TreeItem.dispose() on the child directly (or via getItem(int).dispose()).  GalleryItem does have remove(GalleryItem) and remove(int) but no removeAll().  The same mismatch exists on Gallery vs. Tree.

Gallery does not appear to have equivalents to the Tree.clear(int,boolean) and Tree.clearAll(boolean) methods, nor the TreeItem.clear(int,boolean) and TreeItem.clearAll(boolean).  These methods are intended mainly for use with the VIRTUAL style to force a refresh of items during the next repaint.  They do not remove any items from the widget or change the structure of the widget.
Comment 1 Nicolas Richeton CLA 2008-02-23 07:11:44 EST
Since the Gallery can also be used as a table, I think it's better to keep clear(int) and remove(int) which come from the Table API. 
You're right about the mismatch between remove and clear, the later was removing items from non virtual libraries. 

I'm currently fixing these errors and adding the missing methods and unit tests. Some fixes have already been committed.
Comment 2 Nicolas Richeton CLA 2009-04-16 08:28:24 EDT
Anything left to do here ? 

Peter, is the current behavior and API ok for you ?
Comment 3 Wim Jongman CLA 2019-12-12 15:57:35 EST
This bug does not have a target milestone assigned and is automatically closed as part of the 2.3.0 release cleanup.

It could be that this bug is accidentally closed for which we apologize.

If this bug is still relevant, please re-open and set a target milestone.