Re: Databinding Multiple Items in an Table [message #331727] |
Thu, 18 September 2008 14:29 |
Thomas Schindl![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=tom.schindl%40bestsolution.at) 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
------------------------------------------------------------ --------
|
|
|
Powered by
FUDForum. Page generated in 0.04357 seconds