Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » ContainerCheckedTreeViewer and setCheckedElements
ContainerCheckedTreeViewer and setCheckedElements [message #461355] Wed, 21 September 2005 09:26 Go to next message
Keith Smillie is currently offline Keith SmillieFriend
Messages: 3
Registered: July 2009
Junior Member
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 #461379 is a reply to message #461355] Wed, 21 September 2005 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: morincer.gmail.com

21.09.2005 13:26:15
Keith Smillie <do.not@email.me> wrote in message
<Xns96D869F574310frunobulax@206.191.52.34>

> 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

You should use same objects as argument for setCheckedElements() as
you have used for data fill.
Regards,
Andrei Makaro
Re: ContainerCheckedTreeViewer and setCheckedElements [message #461407 is a reply to message #461379] Thu, 22 September 2005 08:16 Go to previous message
Keith Smillie is currently offline Keith SmillieFriend
Messages: 3
Registered: July 2009
Junior Member
>
> 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
Previous Topic:SWT and Qt
Next Topic:Eclipse 3.1 JavaDoc problem
Goto Forum:
  


Current Time: Mon Sep 23 04:41:34 GMT 2019

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

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

Back to the top