Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [DataBinding] TableViewer - ViewerSupport: render converted text or image
[DataBinding] TableViewer - ViewerSupport: render converted text or image [message #633337] Sat, 16 October 2010 17:03 Go to next message
Eclipse UserFriend
Originally posted by: karsten.triadiary.com

Hi,

I use ViewerSupport to bind a List of elements (WritableList) to a
TableViewer. The ValueProperties are 'generated' using
BeanProperties.values(). Everything works well, but I have two issues:

1. How can I change the output of an element in the list? (E.g. I have
BigDecimals that have to be shown with two digits and a currency symbol.)
2. How can I render a field with an image? (E.g. a boolean value should
be show as red or green icon.)

Maybe you have any links or information that I can use to solve that issue.

Thanks.

(Up to now I couldn't find a solution using google or newsgroup search.)

Karsten
Re: [DataBinding] TableViewer - ViewerSupport: render converted text or image [message #633378 is a reply to message #633337] Sun, 17 October 2010 08:19 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

ViewerSupport doesn't work for your usecase and you need to setup a
things your own.

Here's an implementation of a LabelProvider:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf/examples/org.eclipse.emf.examples.databinding.p roject.ui.rcp/src/org/eclipse/emf/example/databinding/projec t/ui/rcp/databinding/GenericMapCellLabelProvider.java?view=m arkup&root=Modeling_Project

and an example on how to set it up:
http://tomsondev.bestsolution.at/2009/06/27/galileo-emf-data binding-part-5/

which use EMF-Databinding but that shouldn't matter and you should get
an idea how to setup a TableViewer.

Tom

Am 16.10.10 19:03, schrieb Karsten Voigt:
> Hi,
>
> I use ViewerSupport to bind a List of elements (WritableList) to a
> TableViewer. The ValueProperties are 'generated' using
> BeanProperties.values(). Everything works well, but I have two issues:
>
> 1. How can I change the output of an element in the list? (E.g. I have
> BigDecimals that have to be shown with two digits and a currency symbol.)
> 2. How can I render a field with an image? (E.g. a boolean value should
> be show as red or green icon.)
>
> Maybe you have any links or information that I can use to solve that issue.
>
> Thanks.
>
> (Up to now I couldn't find a solution using google or newsgroup search.)
>
> Karsten
Re: [DataBinding] TableViewer - ViewerSupport: render converted text or image [message #633396 is a reply to message #633378] Sun, 17 October 2010 12:22 Go to previous message
Eclipse UserFriend
Originally posted by: karsten.triadiary.com

Hi,

thanks. so I'll try to implement it on my own :-). At least I've already
done that stuff with databinding.

Karsten

Am 17.10.2010 10:19, schrieb Tom Schindl:
> Hi,
>
> ViewerSupport doesn't work for your usecase and you need to setup a
> things your own.
>
> Here's an implementation of a LabelProvider:
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf/examples/org.eclipse.emf.examples.databinding.p roject.ui.rcp/src/org/eclipse/emf/example/databinding/projec t/ui/rcp/databinding/GenericMapCellLabelProvider.java?view=m arkup&root=Modeling_Project
>
> and an example on how to set it up:
> http://tomsondev.bestsolution.at/2009/06/27/galileo-emf-data binding-part-5/
>
> which use EMF-Databinding but that shouldn't matter and you should get
> an idea how to setup a TableViewer.
>
> Tom
>
> Am 16.10.10 19:03, schrieb Karsten Voigt:
>> Hi,
>>
>> I use ViewerSupport to bind a List of elements (WritableList) to a
>> TableViewer. The ValueProperties are 'generated' using
>> BeanProperties.values(). Everything works well, but I have two issues:
>>
>> 1. How can I change the output of an element in the list? (E.g. I have
>> BigDecimals that have to be shown with two digits and a currency symbol.)
>> 2. How can I render a field with an image? (E.g. a boolean value should
>> be show as red or green icon.)
>>
>> Maybe you have any links or information that I can use to solve that issue.
>>
>> Thanks.
>>
>> (Up to now I couldn't find a solution using google or newsgroup search.)
>>
>> Karsten
>
Previous Topic:TableViewer: 'Enter' key default behaviour?
Next Topic:Drag and drop to outside of Eclipse
Goto Forum:
  


Current Time: Sat Apr 27 01:07:40 GMT 2024

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

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

Back to the top