Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » TableViewer Inline Editting Snippet013
TableViewer Inline Editting Snippet013 [message #435232] Thu, 30 July 2009 20:36 Go to next message
Stephen Panosian is currently offline Stephen PanosianFriend
Messages: 7
Registered: July 2009
Junior Member
I've been working off of Snippet013 and trying to expand it.

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.e xamples.databinding/src/org/eclipse/jface/examples/databindi ng/snippets/Snippet013TableViewerEditing.java?view=markup

I was wondering if there was a way to bind table cells to arrays and
vector lists? The snippet shows how to bind to object elements such as a
class Person with member "name". I'd like to be able to work with a class
Person which has a list of strings called "friends" or an array of doubles
called "bodyProperties".

I tried things during the binding such as

ViewerSupport.bind(viewer, new WritableList(person, Person.class),
BeansProperties.values(Person.class, friends.elementData[0]));

or

ViewerSupport.bind(viewer, new WritableList(person, Person.class),
BeansProperties.values(Person.class, bodyProperties[0]));

but I haven't had much luck. Is this type of binding possible? Am I on the
right track? Any help would be appreciated. Thanks

Stephen
Re: TableViewer Inline Editting Snippet013 [message #478994 is a reply to message #435232] Fri, 07 August 2009 21:46 Go to previous messageGo to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
Not sure what you are trying to do. Do you want "friends" to be the
columns? e.g.

|friend[0]|friend[1]|friend[2]|etc...|

"Stephen Panosian" <stephen.panosian@gmail.com> wrote in message
news:426e15cc9e0c752cecc73b898ffefe93$1@www.eclipse.org...
> I've been working off of Snippet013 and trying to expand it.
>
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.e xamples.databinding/src/org/eclipse/jface/examples/databindi ng/snippets/Snippet013TableViewerEditing.java?view=markup
>
> I was wondering if there was a way to bind table cells to arrays and
> vector lists? The snippet shows how to bind to object elements such as a
> class Person with member "name". I'd like to be able to work with a class
> Person which has a list of strings called "friends" or an array of doubles
> called "bodyProperties".
> I tried things during the binding such as
> ViewerSupport.bind(viewer, new WritableList(person, Person.class),
> BeansProperties.values(Person.class, friends.elementData[0]));
>
> or
> ViewerSupport.bind(viewer, new WritableList(person, Person.class),
> BeansProperties.values(Person.class, bodyProperties[0]));
>
> but I haven't had much luck. Is this type of binding possible? Am I on the
> right track? Any help would be appreciated. Thanks
>
> Stephen
>
Re: TableViewer Inline Editting Snippet013 [message #479364 is a reply to message #478994] Mon, 10 August 2009 18:27 Go to previous messageGo to next message
Stephen Panosian is currently offline Stephen PanosianFriend
Messages: 7
Registered: July 2009
Junior Member
Yea I want each element of the array or the vector to have its own column.
Re: TableViewer Inline Editting Snippet013 [message #482456 is a reply to message #479364] Wed, 26 August 2009 15:28 Go to previous message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
This won't work because arrays don't fire change notification so you can
bind to its elements. You can just write an ITableLabelProvider, but it
won't be dynamic - you have to manually refresh the rows when the array
changes.

"Stephen Panosian" <stephen.panosian@gmail.com> wrote in message
news:e1254e4597a9fcc4fe0292a39b633ac5$1@www.eclipse.org...
> Yea I want each element of the array or the vector to have its own column.
>
Previous Topic:Setting ViewerFilter and fatal JRE error
Next Topic:[databinding] Using TreeViewer with ViewerSupport.bind(...)
Goto Forum:
  


Current Time: Fri Apr 26 05:35:11 GMT 2024

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

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

Back to the top