Arrays as dynamic properties (TableViewer Databinding) [message #1006988] |
Sun, 03 February 2013 10:25  |
Eclipse User |
|
|
|
Hi everyone,
I got in heavy trouble with JFace databinding and had a look on google if there is any solution but found nothing.
The goal is to use the elements of an dynamic array as "properties", whereby each change to an element should be reflected in the table. The number of elements in the Array is NOT fixed, therefore it is not possible (I think) to declare some fields in a class (for example an own class like "ROW")
For example:
ArrayList<String> row1= new ArrayList<String();
ArrayList<String> row2= new ArrayList<String();
.... *add some elements to the rows*
ArrayList<ArrayList<String>> RowContainer = new ArrayList<ArrayList<String>>();
RowContainer.add(row1);
RowContainer.add(row2);
I have used this nested arrays at first but then changed it to
Row row1 = new ...
Row row2 = new ...
Entry element1 = new Entry("first string");
Entry element2 = new Entry("second string");
....
row1.add(element1);
...
...
ArrayList<Row> RowContainer = ....
....
whereby the classes Entry and Row contain PropertyChangeSupport methods
Is databinding in this context possible? If yes, a detailed description would be very helpful, thanks a lot
|
|
|
Re: Arrays as dynamic properties (TableViewer Databinding) [message #1008407 is a reply to message #1006988] |
Tue, 12 February 2013 06:14  |
Eclipse User |
|
|
|
If you google "eclipse tableviewer databinding" you should see a link to
the following snippet:
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/plain/examples/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet009TableViewer.java
This shows you how to bind table viewer labels.
HTH,
Nigel Westbury
On 04/02/2013 13:53, Martin Schulze wrote:
> Hi everyone,
>
> I got in heavy trouble with JFace databinding and had a look on google
> if there is any solution but found nothing.
>
> The goal is to use the elements of an dynamic array as "properties",
> whereby each change to an element should be reflected in the table. The
> number of elements in the Array is NOT fixed, therefore it is not
> possible (I think) to declare some fields in a class (for example an own
> class like "ROW")
> For example:
>
>
> ArrayList<String> row1= new ArrayList<String();
> ArrayList<String> row2= new ArrayList<String();
>
> ... *add some elements to the rows*
>
> ArrayList<ArrayList<String>> RowContainer = new
> ArrayList<ArrayList<String>>();
> RowContainer.add(row1);
> RowContainer.add(row2);
>
>
>
> I have used this nested arrays at first but then changed it to
>
>
>
> Row row1 = new ...
> Row row2 = new ...
> Entry element1 = new Entry("first string");
> Entry element2 = new Entry("second string");
> ...
> row1.add(element1);
> ..
> ..
> ArrayList<Row> RowContainer = ....
> ...
>
> whereby the classes Entry and Row contain PropertyChangeSupport methods
>
>
> Is databinding in this context possible? If yes, a detailed description
> would be very helpful, thanks a lot
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03556 seconds