Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » string filter for TreeViewer(refilter according to a string)
string filter for TreeViewer [message #541445] Mon, 21 June 2010 08:41 Go to next message
coly is currently offline colyFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,
I use treeviewer to manager a series of filenames and directories,

the tree may be as follows:

root
xyz.dir
abc.file
axy.file
bb.file
xzf.dir
bc.file
yz.file

now, I have a string from a Text, and I want to filter the treeviewer nodes according to this string. For example,

if the string is "x", then the treeviewer should be as follows:
root
xyz.dir
axy.file
xzf.dir

if the string is "xy", then
root
xyz.dir
axy.file

this is the function that I want to realize, and I try to use ViewFilter, but I failed.

Can anyone provide some suggestions?

coly.
Re: string filter for TreeViewer [message #541549 is a reply to message #541445] Mon, 21 June 2010 13:13 Go to previous message
Eclipse UserFriend
Originally posted by: gemaspecial.yahoo.com.hk

Try FilteredTreeViewer

On 6/21/2010 4:41 PM, coly wrote:
> Hi, I use treeviewer to manager a series of filenames and directories,
>
> the tree may be as follows:
>
> root
> xyz.dir
> abc.file
> axy.file
> bb.file
> xzf.dir
> bc.file
> yz.file
>
> now, I have a string from a Text, and I want to filter the treeviewer
> nodes according to this string. For example,
>
> if the string is "x", then the treeviewer should be as follows:
> root
> xyz.dir
> axy.file
> xzf.dir
>
> if the string is "xy", then root
> xyz.dir
> axy.file
>
> this is the function that I want to realize, and I try to use
> ViewFilter, but I failed.
> Can anyone provide some suggestions?
>
> coly.
>
Previous Topic:Treeviewer cuts of last pixel of last letter
Next Topic:Closing a view programmatically before shutdown
Goto Forum:
  


Current Time: Wed Apr 24 21:59:05 GMT 2024

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

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

Back to the top