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
protected abstract void internalRefresh(Object element);
	/**
	 * Refreshes this viewer starting at the given element. Labels are updated
	 * as described in <code>refresh(boolean updateLabels)</code>.
	 * <p>
	 * The default implementation simply calls
	 * <code>internalRefresh(element)</code>, ignoring
	 * <code>updateLabels</code>.
	 * <p>
	 * If this method is overridden to do the actual refresh, then
	 * <code>internalRefresh(Object element)</code> should simply call
	 * <code>internalRefresh(element, true)</code>.
	 * 
	 * @param element
	 *            the element
	 * @param updateLabels
	 *            <code>true</code> to update labels for existing elements,
	 *            <code>false</code> to only update labels as needed, assuming
	 *            that labels for existing elements are unchanged.
	 * 
	 * @since 2.0
	 */
	protected void internalRefresh(Object element, boolean updateLabels) {
		internalRefresh(element);
	}
	/**
	 * Adds the element item pair to the element map.
	 * <p>
	 * This method is internal to the framework; subclassers should not call
	 * this method.