ContainerCheckedTreeViewer and setCheckedElements [message #461355] |
Wed, 21 September 2005 05:26  |
Eclipse User |
|
|
|
All,
I have a ContainerCheckedTreeViewer which is showing part of the Workbench
via a WorkbenchContentProvider and a WorkbenchLabelProvider.
The tree viewer is used to ask a user to select a number of resources to be
exported to a system external to Eclipse.
I also have a list of Strings of filenames of 'selected' files. The Strings
contain the project relative path of the selected files. This list has come
from a system external to Eclipse.
How can I initialise the tree viewer so that the selected files are
initially checked?
I have tried using the setCheckedElements() method on the tree viewer and
supplying an array of java.io.Files, IFile's or IResource's but none of
these seem to work.
What kind of objects to I need to provide?
I can't simply store the previous selection because only a 'live' query to
the external system can give me that information.
Regards, Keith
|
|
|
|
Re: ContainerCheckedTreeViewer and setCheckedElements [message #461407 is a reply to message #461379] |
Thu, 22 September 2005 04:16  |
Eclipse User |
|
|
|
>
> You should use same objects as argument for setCheckedElements() as
> you have used for data fill.
> Regards,
> Andrei Makaro
>
Hi Andrei,
That's exactly what I am trying to understand. What Objects are used for
the data fill. I am using a WorkbenchContentProvider to display part of the
Workbench - specifically the contents of a particular folder. The folder
simply contains gifs, jpegs and other simple file resources.
The treeview show the files and folders etc so I would expect the Objects
to be IFiles and IFolders or possibly IResources but that doesn't seem to
be the case.
I have had a look at the class of the Objects returned from
getCheckedElements() and they are of type
org.eclipse.core.internal.resources.File which is an internal class.
So exactly what class of object should I provide File, IFile, IResource or
something else?
Keith
|
|
|
Powered by
FUDForum. Page generated in 0.06192 seconds