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

Bug 340228

Summary: Add isCached() to TableItem.java
Product: [Eclipse Project] Platform Reporter: Brad <bhlowe>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipse.felipe
Version: 4.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Brad CLA 2011-03-16 15:34:31 EDT
In org.eclipse.swt.widgets.TableItem

make the boolean cached available to developers:

Add function to make the private "cached" field accessible to the public. 

public boolean isCached()
{
    return cached;
}


This added function allows developers to know whether it is required to update the contents of a tableItem in a (VIRTUAL) SWT table.

Reason for this feature:

Say you have a virtual list of 500K items, with 100 table items viewed by the user (cached is true). Through some background activity, 500 list items change and their text values must be updated.. but only 1 item has been drawn (and is "cached"). By knowing this, we can just update the "visible" or recently viewed. All other tableitems will be redrawn correctly when the user scrolls through the data, using the virtual mechanism already in place.

I use this in my Tables to "redrawRow(Obect t)" and redrawRows(ArrayList l) so that I can speed up updates to the list. 

Thanks.
Comment 1 Felipe Heidrich CLA 2011-03-24 09:37:33 EDT
see
Table#clear(int)
Table#clear(int,int)
Table#clear(int[])
Table#clearAll()