Anand
Anand

Reputation: 2359

How to create Filter for org.eclipse.jface.viewers.CheckboxTreeViewer?

I have to create Filter for my CheckboxTreeViewer. I'm not getting how to do that. I'm using following class

org.eclipse.pde.internal.ui.shared.FilteredCheckboxTree

and following way to get the FilteredCheckboxTree object:

FilteredTree ft = new FilteredCheckboxTree(parent, null, 0, null);

but it is telling me:

The constructor FilteredCheckboxTree(Composite, FormToolkit, int, PatternFilter) refers to the missing type FormToolkit.

I'm not getting what exactly the problem is. Please help if you know about it. Or if there is any other way to get Filter then do let me know.

Thanks in advance!!!

Upvotes: 1

Views: 670

Answers (1)

Alexey Romanov
Alexey Romanov

Reputation: 170723

  1. Add a dependency on org.eclipse.ui.forms (which contains FormToolkit) to your plug-in.

  2. Much better, to avoid dependency on internal packages, use org.eclipse.ui.dialogs.FilteredTree and override doCreateTreeViewer.

Upvotes: 2

Related Questions