| 
| Lazy Virtual Tables and Views [message #330335] | Fri, 25 July 2008 12:22 |  | 
| Eclipse User  |  |  |  |  | I recently implemented a virtual table (within a table viewer) using the ILazyContentProvider. When the program comes up, and the view containing
 the table is active, the table is populated without any issues. However,
 if I were to close the view and bring the view back up, the table does not
 retain any of its data. If I bring up the program and the view is not
 active, the same behavior occurs where no data is ever displayed.
 
 Has anyone ran into a similar issue?
 
 I have included an abridged version of the content provider I am using.
 Any help would be greatly appreciated.
 
 public class InventoryContentProvider
 implements ILazyContentProvider, InventoryListener
 {
 private TableViewer m_tableViewer;
 
 public void inputChanged(Viewer viewer, Object oldInput, Object
 newInput)
 {
 if (oldInput != newInput && oldInput != null)
 ((InventoryManager)oldInput).removeInventoryListener(this);
 
 if (newInput != oldInput && newInput != null)
 ((InventoryManager)newInput).addInventoryListener(this);
 
 m_tableViewer = (TableViewer) viewer;
 m_tableViewer.getTable().clearAll();
 }
 
 public void dispose() {}
 
 @Override
 public void updateElement(int index)
 {
 if (m_tableViewer.getContentProvider() != null) {
 m_tableViewer.replace(m_tableViewer.getElementAt(index),
 index);
 }
 }
 }
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03096 seconds