Bug 102539 - [Model] Static implementation of hasChildren() Method in BaseWorkbenchContentProvider
Summary: [Model] Static implementation of hasChildren() Method in BaseWorkbenchContent...
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, needinfo, performance
Depends on:
Blocks:
 
Reported: 2005-07-01 18:19 EDT by Stefan Lötscher CLA
Modified: 2009-08-30 02:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Lötscher CLA 2005-07-01 18:19:23 EDT
If you want to load data in TreeViewer in a dynamic way e.g. lazy loading from a server in RCP 
applications, the implementation of hasChildren() in BaseWorkbenchContentProvider is not optimal. 
Actually it is implemented as follows:

public boolean hasChildren(Object element) {
    return getChildren(element).length > 0;
}

better would be:

public boolean hasChildren(Object element) {
        IExtendedWorkbenchAdapter adapter = (IExtendedWorkbenchAdapter) getAdapter(element);
        if (adapter != null) {
            return adapter.hasChildren(element);
        }
        return getChildren(element).length > 0;
    }

This gives us the possibility to load data dynamically only if the node is really expanded. Additionally, it 
looks inconsistent if that method is not adaptable but all others are.
Comment 1 Nick Edgar CLA 2006-03-15 11:19:27 EST
Reassigning bugs in component areas that are changing ownership.
Comment 2 Tod Creasey CLA 2006-04-07 14:44:04 EDT
There are no plans to work on this feature
Comment 3 Denis Roy CLA 2009-08-30 02:10:22 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.