|
Lines 83-88
Link Here
|
| 83 |
import org.eclipse.swt.widgets.Label; |
83 |
import org.eclipse.swt.widgets.Label; |
| 84 |
import org.eclipse.swt.widgets.Menu; |
84 |
import org.eclipse.swt.widgets.Menu; |
| 85 |
import org.eclipse.swt.widgets.Shell; |
85 |
import org.eclipse.swt.widgets.Shell; |
|
|
86 |
import org.eclipse.swt.widgets.Table; |
| 86 |
import org.eclipse.swt.widgets.Text; |
87 |
import org.eclipse.swt.widgets.Text; |
| 87 |
import org.eclipse.swt.widgets.ToolBar; |
88 |
import org.eclipse.swt.widgets.ToolBar; |
| 88 |
import org.eclipse.swt.widgets.ToolItem; |
89 |
import org.eclipse.swt.widgets.ToolItem; |
|
Lines 785-791
Link Here
|
| 785 |
if (list != null && !list.getTable().isDisposed()) { |
786 |
if (list != null && !list.getTable().isDisposed()) { |
| 786 |
|
787 |
|
| 787 |
list.setItemCount(contentProvider.getElements(null).length); |
788 |
list.setItemCount(contentProvider.getElements(null).length); |
| 788 |
list.refresh(); |
789 |
contentProvider.internalRefresh(); |
| 789 |
|
790 |
|
| 790 |
if (list.getTable().getItemCount() > 0) { |
791 |
if (list.getTable().getItemCount() > 0) { |
| 791 |
list.getTable().deselectAll(); |
792 |
list.getTable().deselectAll(); |
|
Lines 2433-2438
Link Here
|
| 2433 |
scheduleRefresh(); |
2434 |
scheduleRefresh(); |
| 2434 |
} |
2435 |
} |
| 2435 |
|
2436 |
|
|
|
2437 |
private void internalRefresh() { |
| 2438 |
|
| 2439 |
int lastFilteredItemsSize = lastFilteredItems.size(); |
| 2440 |
|
| 2441 |
if (lastFilteredItems.size() != items.size()) |
| 2442 |
reloadCache(false, null); |
| 2443 |
|
| 2444 |
Table table = list.getTable(); |
| 2445 |
if (table.getItemCount() == 0 || lastFilteredItemsSize == 0 || lastCompletedFilter == null) { |
| 2446 |
list.refresh(true); |
| 2447 |
} else { |
| 2448 |
int topVisible = table.getTopIndex(); |
| 2449 |
int numberOfVisible = table.getClientArea().height |
| 2450 |
/ table.getItems()[0].getBounds().height + 1; |
| 2451 |
for (int i = 0; i < numberOfVisible; i++) { |
| 2452 |
|
| 2453 |
int index = topVisible + i; |
| 2454 |
Object newElement = null; |
| 2455 |
Object oldElement = list.getElementAt(index); |
| 2456 |
|
| 2457 |
if (index < lastFilteredItems.size()) { |
| 2458 |
newElement = lastFilteredItems.get(index); |
| 2459 |
} |
| 2460 |
|
| 2461 |
if (newElement != null && oldElement != null |
| 2462 |
&& !newElement.equals(oldElement)) { |
| 2463 |
if (index >= table.getItemCount()) { |
| 2464 |
list.add(newElement); |
| 2465 |
} else { |
| 2466 |
list.replace(newElement, index); |
| 2467 |
} |
| 2468 |
} |
| 2469 |
|
| 2470 |
} |
| 2471 |
} |
| 2472 |
} |
| 2473 |
|
| 2436 |
/** |
2474 |
/** |
| 2437 |
* Sets progress message. |
2475 |
* Sets progress message. |
| 2438 |
* |
2476 |
* |