Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » FilteredTree not working correctly for custom TreeViewer
FilteredTree not working correctly for custom TreeViewer [message #955656] Wed, 24 October 2012 00:14 Go to next message
Wishwas Mohan is currently offline 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 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 563
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 #956635 is a reply to message #956038] Wed, 24 October 2012 17:31 Go to previous messageGo to next message
Wishwas Mohan is currently offline Wishwas Mohan
Messages: 38
Registered: July 2009
Member
I have added the bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=392775

In the meanwhile, please do let me know if you know of other reasons why my code might not be working.

Though the custom tree viewer is not extending NotifyingTreeViewer, it should atleast work though with some refresh issues I guess.
Re: FilteredTree not working correctly for custom TreeViewer [message #958028 is a reply to message #956635] Thu, 25 October 2012 17:41 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 563
Registered: July 2009
Senior Member
Did you try to wrap the TreeViewer that you create in doCreateTreeViewer
into a copied version of NotifyingTreeviewer?
If this doesn't help the problem lies probably somewhere else...

On 24.10.2012 19:31, Wishwas Mohan wrote:
> I have added the bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=392775
>
> In the meanwhile, please do let me know if you know of other reasons why
> my code might not be working.
> Though the custom tree viewer is not extending NotifyingTreeViewer, it
> should atleast work though with some refresh issues I guess.--
Rüdiger Herrmann
http://codeaffine.com
Re: FilteredTree not working correctly for custom TreeViewer [message #958340 is a reply to message #958028] Thu, 25 October 2012 23:40 Go to previous messageGo to next message
Wishwas Mohan is currently offline Wishwas Mohan
Messages: 38
Registered: July 2009
Member
Rüdiger,

If you meant, copying the contents of the NotifyingTreeViewer, that is not possible since the setUseCache method has default visibility.

I am actually using it in a pagebookview. Am not sure if that could be a problem.

I have the tree shown but dont have the filtertext. The filter text is getting created but is not showing up in my view for some reason.

Thanks.
Re: FilteredTree not working correctly for custom TreeViewer [message #958922 is a reply to message #958340] Fri, 26 October 2012 10:13 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 563
Registered: July 2009
Senior Member
On 26.10.2012 01:40, Wishwas Mohan wrote:
> Rüdiger,
>
> If you meant, copying the contents of the NotifyingTreeViewer, that is
> not possible since the setUseCache method has default visibility.
from looking at the code it seems that the pattern-filter only uses a
cache if the treeViewer is an instance of NotifyingTreeViewer (see
method createTreeControl). Hence you should be able to create your
custom tree-viewer without having to wrap it into a NotifyingTreeViewer.

>
> I am actually using it in a pagebookview. Am not sure if that could be a
> problem.
>
> I have the tree shown but dont have the filtertext. The filter text is
> getting created but is not showing up in my view for some reason.
This seems a different issue altogether. Are you still using a custom
tree-viewer? Does the filter text re-appear if you use the default tree
viewer? Have you made sure that you are correctly layouting the widgets?

>
> Thanks.--
Rüdiger Herrmann
http://codeaffine.com
Re: FilteredTree not working correctly for custom TreeViewer [message #971634 is a reply to message #958922] Mon, 05 November 2012 02:25 Go to previous messageGo to next message
Wishwas Mohan is currently offline Wishwas Mohan
Messages: 38
Registered: July 2009
Member
I am sorry I coudnt reply earlier. I was off for a bit. I will be working on it this week and let you know.
Re: FilteredTree not working correctly for custom TreeViewer [message #976967 is a reply to message #971634] Fri, 09 November 2012 00:35 Go to previous messageGo to next message
Wishwas Mohan is currently offline Wishwas Mohan
Messages: 38
Registered: July 2009
Member
I tried using the TreeViewer. It does work.

However, the problem is when this is viewed in a PageBookView. In case of a PageBookView, the parent composite needs to be a PageBook. So, When I override the doCreateTreeViewer by creating the TreeViewer with a PageBook as parent, the tree is created. However, the filtertext is not created since the parent composite is different.

I am trying to find the issue.

Please let me know if you have any suggestions on this.
Re: FilteredTree not working correctly for custom TreeViewer [message #982047 is a reply to message #976967] Mon, 12 November 2012 22:38 Go to previous message
Wishwas Mohan is currently offline 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

Previous Topic:Excel file generated by poi can not been downloaded in IE6?
Next Topic:rwt standalone rap 1.5 deployed in jboss occror error like Not installing optional component!
Goto Forum:
  


Current Time: Thu Oct 02 02:26:03 GMT 2014

Powered by FUDForum. Page generated in 0.04341 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software