Bug 184264 - [Viewers] [Viewers] StructuredViewer.update() does not work as properly if Viewer has filters
Summary: [Viewers] [Viewers] StructuredViewer.update() does not work as properly if Vi...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-26 12:22 EDT by Roman Mukhin CLA
Modified: 2019-09-06 15:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mukhin CLA 2007-04-26 12:22:14 EDT
Build ID: I20070323-1616

The lines below are from JavaDoc for StructuredViewer.update().
---------------
If the viewer has a filter which is affected by a change to one of the properties, the element may appear or disappear if the change affects whether or not the element is filtered out. 
---------------
If Viewer has filter it does not work as expected any more.
Unfortunately once element disappears it could not appear any more. (see code below) 
findItems(...) can not find elements any more, because the have been filtered out. A Property (the filter is using to filter) changes but StructuredViewer does not respect this and not refilter or rebild items!

-----------------------
	public void update(Object element, String[] properties) {
		Assert.isNotNull(element);
		Widget[] items = findItems(element);

		for (int i = 0; i < items.length; i++) {
			internalUpdate(items[i], element, properties);
		}		
	}
-------------
Comment 1 Boris Bokowski CLA 2007-04-27 19:36:22 EDT
Deferring since I could not find an easy fix that would not have the potential of breaking subclasses, or introducing a performance issue.

A workaround would be to call refresh() instead.
Comment 2 Roman Mukhin CLA 2007-04-28 07:00:42 EDT
(In reply to comment #1)

I'm using follow workaround:
----------------------------------------
if (null != viewer.testFindItem(myElement)) {
 vewier.update(myElement, elementProperties);
}
else {
 vewier.refresh();
}
----------------------------------------
In most my cases elements are visible.
So it should have better performance.
Comment 3 Boris Bokowski CLA 2008-05-02 14:56:41 EDT
Mass update - removing 3.4 target. This was one of the bugs I marked for investigation (and potential fixing) in 3.4 but I ran out of time. Please ping on the bug if fixing it would be really important for 3.4, and does not require API changes or feature work.
Comment 4 Boris Bokowski CLA 2009-11-26 09:43:01 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 5 Eclipse Webmaster CLA 2019-09-06 15:31:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.