Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Arrays as dynamic properties (TableViewer Databinding)
Arrays as dynamic properties (TableViewer Databinding) [message #1006988] Sun, 03 February 2013 15:25 Go to next message
Martin Schulze is currently offline Martin Schulze
Messages: 1
Registered: February 2013
Junior Member
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 11:14 Go to previous message
Nigel Westbury is currently offline Nigel Westbury
Messages: 16
Registered: July 2009
Junior Member
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
>
>
>
Previous Topic:WritableList casting issues
Next Topic:Tabbed text field using Jface databinding
Goto Forum:
  


Current Time: Wed Oct 01 06:14:58 GMT 2014

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

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