Note that there are some explanatory texts on larger screens.

plurals
  1. POViewing a data matrix in Eclipse (RCP)
    primarykey
    data
    text
    <p>This is how I update my TableViewer that displays a list:</p> <pre class="lang-java prettyprint-override"><code>public void view(MyListClass list) { ViewerSupport.bind( this, new WritableList(list, controller.theClass()), BeanProperties.values(controller.theClass(), controller.strings()) ); } </code></pre> <p><code>controller</code> is an instance of a class that encapsulates my glue code (it is a different class for the two listings; as is <code>controller.theClass()</code>). <code>strings()</code> is an array of property names. MyListClass descends from <code>ArrayList&lt;MyListEntryObject&gt;</code>. That works fine. But, I want to display a matrix of data. <code>MyMatrixClass</code> is a <code>HashMap&lt;Point, MyMatrixEntryObject&gt;</code>. This is what I've tried:</p> <pre class="lang-java prettyprint-override"><code>private void view(MyMatrixClass matrix) { columns(matrix.columns()); List&lt;WritableList&gt; lists = new ArrayList&lt;WritableList&gt;(matrix.rows()); for (MyEntityClass list : matrix.children()) if (list instanceof MyListClass) lists.add(new WritableList((MyListClass) list, controller.theClass())); WritableList[] alists = lists.toArray(new WritableList[0]); MultiList mlist = new MultiList(alists); ViewerSupport.bind( this, mlist, BeanProperties.value(controller.theClass(), "value") ); } </code></pre> <p>This doesn't work. I get null argument popup errors. (Every data model class implements <code>MyEntityClass</code>. Class names have been altered due to this being a proprietary program I'm being employed to develop.)</p> <p>Long story short, how do I use <code>ViewerSupport</code> and <code>BeanProperties</code> to display a matrix of data in a <code>TableViewer</code>?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload