Re: Simple Jface ListViewer [message #330994] |
Wed, 20 August 2008 17:10 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Zardosht Hodaie wrote:
> Hi all,
> i'm not sure if this post belongs to this group. if not sorry.
> Here is my problem. I want to have a simple ListViewer to show some
> elements. The SWT List shows only Strings and does not contains the
> unerlying Objects. JFace ListViewer needs a model. I thought ok, i make
> a list of elements, and set it as the input to my Jface listViewer. And
> i thought every time a change the input list, the changes should also be
> reflected in viewer. But i don't know what kind of list should i use for
> this. And if i have to write a ContentProvider myself?
>
> thanks in advance for your help,
> Zardosht.
Note: copying this to the eclipse.platform newsgroup.
I think you can use an ArrayContentProvider to do what you want; it
should handle any array or Collection as input.
Hope this helps,
Eric
|
|
|
|
Re: Simple Jface ListViewer [message #330998 is a reply to message #330997] |
Wed, 20 August 2008 19:03 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: zhodaie.gmail.com
Tom Schindl schrieb:
> The viewer won't update themselves when the underlying list changes
> (because Java-List don't inform about changes). To make this possible
>
> a) ArrayContentProvider:
> List l = ...
> viewer.setContentProvider(new ArrayContentProvider());
> viewer.setInput(l);
>
> ...
> l.add(new ...)
> viewer.refresh();
>
> b) Databinding with ObservableListContentProvider
>
> IObservableList l = ...
> viewer.setContentProvider(new ObservableListContentProvider());
> viewer.setInput(l);
>
> l.add(new ...);
>
> Tom
>
> Eric Rizzo schrieb:
>> Zardosht Hodaie wrote:
>>> Hi all,
>>> i'm not sure if this post belongs to this group. if not sorry.
>>> Here is my problem. I want to have a simple ListViewer to show some
>>> elements. The SWT List shows only Strings and does not contains the
>>> unerlying Objects. JFace ListViewer needs a model. I thought ok, i
>>> make a list of elements, and set it as the input to my Jface
>>> listViewer. And i thought every time a change the input list, the
>>> changes should also be reflected in viewer. But i don't know what
>>> kind of list should i use for this. And if i have to write a
>>> ContentProvider myself?
>>>
>>> thanks in advance for your help,
>>> Zardosht.
>>
>> Note: copying this to the eclipse.platform newsgroup.
>>
>> I think you can use an ArrayContentProvider to do what you want; it
>> should handle any array or Collection as input.
>>
>> Hope this helps,
>> Eric
>
>
Thank you for your help. I got it working. Thank you.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02971 seconds