Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: Databinding Multiple Items in an Table
Re: Databinding Multiple Items in an Table [message #331727] Thu, 18 September 2008 14:29
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

Are you sure you want to observe the selection of rows in the
TableViewer. Most of the times you want the ArrayList to act as input to
your TableViewer.

If it is the latter you need

Table t = ...
TableColumn t1 = ...
TableColumn t2 = ....
TableViewer v = ...;


ObservableListContentProvider pv = new ObservableListContentProvider();
IObservableMap[] map =
BeanObservables.observeMap(pv.getKnownElements(),
new String[] {"firstname", "lastName"});
ObservableMapLabelProvider lp = new ObservableMapLabelProvider(map);
v.setLabelProvider(lp);

IObservableList list = BeanObservables.observeDetailList(....)
v.setInput(list);

Tom

Andreas Schmid schrieb:
> Hello,
>
> I tried to bind a TableViewer to an ArrayList,
>
> Therefor I found
>
> ViewersObservables.observeMultiSelection(myTableViewer);
>
> for observing the TableViewer.
>
> But how to Observe my ArrayList ?
>
> I tried the following:
>
>
>
> IObservableList modelList =
> BeansObservables.observeDetailList( Realm.getDefault(),
> modelRoot,
> propertyName,
> null);
>
> But this didn't work. (The ArrayList was filled in a way I do not
> understand)
>
> Is there an other way to observer the Bean ?
>
>
>
> public static class Person extends BindingObject{
>
> private String firstName;
> private String lastName;
> private Address address;
> private List<Phonenumber> phoneNumbers = new ArrayList<Phonenumber>();
> }
>
>
> THX
>
> Andreas


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:can the P2 dropins directory be used to try different releases of a plugin/feature ?
Next Topic:Best way to implement lazy multipage editor?
Goto Forum:
  


Current Time: Tue Jul 30 19:34:24 GMT 2024

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

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

Back to the top