FilteredTree not working correctly for custom TreeViewer [message #955656] |
Wed, 24 October 2012 00:14 |
Wishwas Mohan Messages: 38 Registered: July 2009 |
Member |
|
|
Hi,
I have a CustomTreeViewer which extends TreeViewer.
In order to use the FilteredTree, I overrode the method doCreateTreeViewer to return my TreeViewer.
PatternFilter filter = new PatternFilter();
FilteredTree tree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL SWT.V_SCROLL, filter, true){
@Override
protected TreeViewer doCreateTreeViewer(Composite parent,int style) {
return new CustomTreeViewer (parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
}
};
return tree.getViewer();
This is not working. I know that there is a NotifyingTreeViewer which has been introduced to solve the bug 187200 within the FilteredTree but since this is an inner class, I am not able to extend it.
Appreciate any help in this regard,
Cheers !
|
|
|
Re: FilteredTree not working correctly for custom TreeViewer [message #956038 is a reply to message #955656] |
Wed, 24 October 2012 07:29 |
Rüdiger Herrmann Messages: 581 Registered: July 2009 |
Senior Member |
|
|
RAP adopts the workbench as is provided by the Eclipse Platform Project.
If you think the NotifyingTreeViewer should be made public (or whatever
other measures to resolve the problem), please file an enhancement
request against Platform/UI [1].
Please let us know when you filed a bug so that we can adopt the changes
once it got resolved.
HTH
Rüdiger
[1] https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform
On 24.10.2012 02:14, Wishwas Mohan wrote:
> Hi,
>
> I have a CustomTreeViewer which extends TreeViewer.
>
> In order to use the FilteredTree, I overrode the method
> doCreateTreeViewer to return my TreeViewer.
>
>
> PatternFilter filter = new PatternFilter();
> FilteredTree tree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL
> SWT.V_SCROLL, filter, true){
> @Override
> protected TreeViewer doCreateTreeViewer(Composite parent,int style) {
> return new CustomTreeViewer (parent, SWT.MULTI | SWT.H_SCROLL |
> SWT.V_SCROLL);
> }
> };
> return tree.getViewer();
>
> This is not working. I know that there is a NotifyingTreeViewer which
> has been introduced to solve the bug 187200 within the FilteredTree but
> since this is an inner class, I am not able to extend it.
>
> Appreciate any help in this regard,
>
> Cheers !
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
|
|
|
|
|
|
Re: FilteredTree not working correctly for custom TreeViewer [message #982047 is a reply to message #976967] |
Mon, 12 November 2012 22:38 |
Wishwas Mohan Messages: 38 Registered: July 2009 |
Member |
|
|
Hi Rüdiger,
I think I found the problem. When I create a pagebook view, the control needs to be the pagebook. However, when I create a FilteredTree and get the treeviewer from it, the tree viewer's control is the tree rather than the Pagebook. This was causing the problem. So, I just needed to make sure that I recursively get to the Pagebook which is the parent of the FilteredTree which is actually the parent of the tree to fix the problem.
Thanks a lot for your help.
[Updated on: Mon, 12 November 2012 22:53] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03839 seconds