Bug 24521 [Viewers] TreeViewer.update() does not work correctly with filter
When I add an element which does not satisfy the filtering condition and then update it so that it does, call to update does not show the element. This is because[StructuredViewer.update]: public void update(Object element, String[] properties) { Assert.isNotNull(element); | Widget item = findItem(element); | if (item == null) | return; the code silently ignores that the element may become visible... btw. later in code of this method: if (needsRefilter) { refresh(); return; } This is quite inefficient, as it needs to query all visible items; however only one element may actually change (change visibility and/or sort order).
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StructuredViewer.java
/**
	 * A map from the viewer's model elements to SWT widgets. (key type:
	 * <code>Object</code>, value type: <code>Widget</code>, or <code>Widget[]</code>).
	 * <code>null</code> means that the element map is disabled.
	 */
	private CustomHashtable elementMap;
	/**
	 * The comparer to use for comparing elements, or <code>null</code> to use
	 * the default <code>equals</code> and <code>hashCode</code> methods on
	 * the element itself.
	 */
	private IElementComparer comparer;
	/**
	 * This viewer's comparator used for sorting. <code>null</code> means there is no comparator.
	 */
	private ViewerComparator sorter;
	/**
	 * This viewer's filters (element type: <code>ViewerFilter</code>).
	 * <code>null</code> means there are no filters.
	 */
	private List filters;
	/**
	 * Indicates whether a selection change is in progress on this viewer.
	 * 
	 * @see #setSelection(ISelection, boolean)
	 */
	private boolean inChange;
	/**
	 * Used while a selection change is in progress on this viewer to indicates
	 * whether the selection should be restored.