Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Can the FilteredList have columns?
Can the FilteredList have columns? [message #334538] Mon, 16 February 2009 21:00 Go to next message
Eclipse UserFriend
Originally posted by: wbeckwith.gmail.com

The FilteredList class seems to be what I need from a UI since, however,
I need several columns to be a part of the list with the associated
sorting by column. Is this class extensible in this way or via
subclassing or am I looking at creating a new Composite with the same
behavior?

Wb
Re: Can the FilteredList have columns? [message #334541 is a reply to message #334538] Mon, 16 February 2009 22:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 2/16/2009 4:00 PM, Wendell Beckwith wrote:
> The FilteredList class seems to be what I need from a UI since, however,
> I need several columns to be a part of the list with the associated
> sorting by column. Is this class extensible in this way or via
> subclassing or am I looking at creating a new Composite with the same
> behavior?

Any reason you can not use a TableViewer instead? It extends
StructuredViewer which supports filtering and column-based sorting. See
this snippet for example:
http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet040Ta bleViewerSorting

Hope this helps,
Eric
Re: Can the FilteredList have columns? [message #334543 is a reply to message #334541] Mon, 16 February 2009 23:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wbeckwith.gmail.com

Well mainly we are porting a Swing UI which has a table with a text
field that filters the table entries as the user types in it. Exactly
what the FilteredList and FilteredTree do. The only difference between
the 2 is that our current UI element actually has several columns. Plus
the FilteredList/Tree classes have UI enhancements to clear the text
control, etc.

While we could try and concatenate the column strings into a single line
of text to be included in the FilteredList, the info likely will not
line up as nicely as in table columns proper. We could also create our
own composite with a text control and a tableviewer, but we was hoping
to reuse and customize the FilteredList class if possible. No need to
suffer from NIH if we don't have to.

Wb



Eric Rizzo wrote:
> On 2/16/2009 4:00 PM, Wendell Beckwith wrote:
>> The FilteredList class seems to be what I need from a UI since, however,
>> I need several columns to be a part of the list with the associated
>> sorting by column. Is this class extensible in this way or via
>> subclassing or am I looking at creating a new Composite with the same
>> behavior?
>
> Any reason you can not use a TableViewer instead? It extends
> StructuredViewer which supports filtering and column-based sorting. See
> this snippet for example:
> http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet040Ta bleViewerSorting
>
>
> Hope this helps,
> Eric
Re: Can the FilteredList have columns? [message #334553 is a reply to message #334543] Tue, 17 February 2009 15:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 2/16/2009 6:42 PM, Wendell Beckwith wrote:
> Well mainly we are porting a Swing UI which has a table with a text
> field that filters the table entries as the user types in it. Exactly
> what the FilteredList and FilteredTree do. The only difference between
> the 2 is that our current UI element actually has several columns. Plus
> the FilteredList/Tree classes have UI enhancements to clear the text
> control, etc.
>
> While we could try and concatenate the column strings into a single line
> of text to be included in the FilteredList, the info likely will not
> line up as nicely as in table columns proper. We could also create our
> own composite with a text control and a tableviewer, but we was hoping
> to reuse and customize the FilteredList class if possible. No need to
> suffer from NIH if we don't have to.

Ah, FilteredTree is your key then. A TreeViewer can actually have
multiple columns. Again, have a look at the JFace Snippets, in
particular this one (I think) demonstrates a tree with multiple columns:
http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet027Tr eeLayout

In general, keep in mind that TreeViewer and TableViewer are VERY
similar and share the same inheritance hierarchy.

That should get you pretty close to what you want, although I'm not
certain about column-based sorting on a tree (I've only done it for a
TableViewer).

Eric



> Eric Rizzo wrote:
>> On 2/16/2009 4:00 PM, Wendell Beckwith wrote:
>>> The FilteredList class seems to be what I need from a UI since, however,
>>> I need several columns to be a part of the list with the associated
>>> sorting by column. Is this class extensible in this way or via
>>> subclassing or am I looking at creating a new Composite with the same
>>> behavior?
>>
>> Any reason you can not use a TableViewer instead? It extends
>> StructuredViewer which supports filtering and column-based sorting.
>> See this snippet for example:
>> http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet040Ta bleViewerSorting
>>
>>
>> Hope this helps,
>> Eric
Re: Can the FilteredList have columns? [message #334809 is a reply to message #334553] Fri, 27 February 2009 23:57 Go to previous message
Eclipse UserFriend
Originally posted by: wbeckwith.gmail.com

Thanks for the help, I was able to get the FilteredTree to work with a
few caveats. 1st, I had to create my own FilteredTreeColumnLayout class
and add a "Tree getTree(Scrollable)" method since the takes a
scrollable and always casts it to a Tree, but it the Scrollable is a
FilteredTree then we need to get the Tree from that composite and return
that. I'll see about submitting a patch. The other caveat is that even
though I was using the FilteredTree as a list with no children the 1st
column had space reserved for the toggle handles which made the strings
look centered.

I'll look at the FilteredList next to see if I can make a similar change
to remove the 2nd caveat. Otherwise it was/is working fine.

Wb

Eric Rizzo wrote:
> On 2/16/2009 6:42 PM, Wendell Beckwith wrote:
>> Well mainly we are porting a Swing UI which has a table with a text
>> field that filters the table entries as the user types in it. Exactly
>> what the FilteredList and FilteredTree do. The only difference between
>> the 2 is that our current UI element actually has several columns. Plus
>> the FilteredList/Tree classes have UI enhancements to clear the text
>> control, etc.
>>
>> While we could try and concatenate the column strings into a single line
>> of text to be included in the FilteredList, the info likely will not
>> line up as nicely as in table columns proper. We could also create our
>> own composite with a text control and a tableviewer, but we was hoping
>> to reuse and customize the FilteredList class if possible. No need to
>> suffer from NIH if we don't have to.
>
> Ah, FilteredTree is your key then. A TreeViewer can actually have
> multiple columns. Again, have a look at the JFace Snippets, in
> particular this one (I think) demonstrates a tree with multiple columns:
> http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet027Tr eeLayout
>
> In general, keep in mind that TreeViewer and TableViewer are VERY
> similar and share the same inheritance hierarchy.
>
> That should get you pretty close to what you want, although I'm not
> certain about column-based sorting on a tree (I've only done it for a
> TableViewer).
>
> Eric
>
>
>
>> Eric Rizzo wrote:
>>> On 2/16/2009 4:00 PM, Wendell Beckwith wrote:
>>>> The FilteredList class seems to be what I need from a UI since,
>>>> however,
>>>> I need several columns to be a part of the list with the associated
>>>> sorting by column. Is this class extensible in this way or via
>>>> subclassing or am I looking at creating a new Composite with the same
>>>> behavior?
>>>
>>> Any reason you can not use a TableViewer instead? It extends
>>> StructuredViewer which supports filtering and column-based sorting.
>>> See this snippet for example:
>>> http://wiki.eclipse.org/index.php/JFaceSnippets#Snippet040Ta bleViewerSorting
>>>
>>>
>>>
>>> Hope this helps,
>>> Eric
>
Previous Topic:Library Example ZIP.
Next Topic:Expose encoding validation to another plugins
Goto Forum:
  


Current Time: Thu Apr 18 15:07:09 GMT 2024

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

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

Back to the top