Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 292458 - Working set filtered checkbox tree loses selection
Summary: Working set filtered checkbox tree loses selection
Status: CLOSED WONTFIX
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-15 15:30 EDT by Steffen Pingel CLA
Modified: 2019-09-21 14:42 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2009-10-15 15:30:58 EDT
Steps:
1. Enable Window Working Set action group
2. Window > Working Sets > Edit > New
3. Select Plug-ins and Fragments
4. Make a selection
5. Type filter text
6. Clear filter text

The result is that the previous selection is lost.

The code is similar to Mylyn's multi-select combo box implementation that is used in the task editor (bug 292433):

	private class CheckboxFilteredTree extends FilteredTree {

		public CheckboxFilteredTree(Composite parent, int treeStyle, PatternFilter filter) {
			super(parent, treeStyle, filter);
		}

		@Override
		protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
			return new CheckboxTreeViewer(parent, style);
		}

		@Override
		public CheckboxTreeViewer getViewer() {
			return (CheckboxTreeViewer) super.getViewer();
		}

	}
	
To fix it Mylyn manually tracks the selected items and has the following work around:
		
		@Override
		protected WorkbenchJob doCreateRefreshJob() {
			WorkbenchJob job = super.doCreateRefreshJob();
			job.addJobChangeListener(new JobChangeAdapter() {
				@Override
				public void done(IJobChangeEvent event) {
					if (event.getResult() != null && event.getResult().isOK() && !getViewer().getTree().isDisposed()) {
						getViewer().setCheckedElements(selectedValues.toArray());
					}
				}
			});
			return job;
		}
Comment 1 Boris Bokowski CLA 2009-11-26 09:53:17 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.
Comment 2 Dani Megert CLA 2010-02-01 10:58:11 EST
This code is custom to PDE (there's no public FilteredCheckboxTree, see bug 220668).
Comment 3 Steffen Pingel CLA 2010-02-01 12:10:27 EST
True, but I believe the cause of the problem is still in CheckboxTreeViewer or FilteredTree.
Comment 4 Dani Megert CLA 2010-02-01 12:17:54 EST
>True, but I believe the cause of the problem is still in CheckboxTreeViewer or
>FilteredTree.
Well, they don't know of each other and it's currently created locally by PDE. The best path is to fix bug 220668 but even then PDE needs to adjust its code.
Comment 5 Curtis Windatt CLA 2010-02-08 12:27:42 EST
I've been working with an alternative FilteredCheckboxTree for PDE that might be able to be applied to this case.  I'll assign it to myself, but I don't know if it will be worked on for 3.6.
Comment 6 Eclipse Genie CLA 2019-09-21 14:42:22 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.

--
The automated Eclipse Genie.