Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 282864 - Create ListRidget as simplification of TableRidget
Summary: Create ListRidget as simplification of TableRidget
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.2.0.M1   Edit
Assignee: Elias Volanakis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 10:50 EDT by Christian Campo CLA
Modified: 2011-05-19 03:51 EDT (History)
0 users

See Also:


Attachments
added simplified bindToModel-Method (4.66 KB, patch)
2009-07-23 04:27 EDT, Steffen Kriese CLA
no flags Details | Diff
simplified bindToModel-Method + TestCase (7.67 KB, patch)
2009-07-23 07:15 EDT, Steffen Kriese CLA
christian.campo: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Campo CLA 2009-07-08 10:50:05 EDT
Currently a List Widget can be accessed using the TableRidget (as a Table with one column and no header). Two issues here:

a) Its surprising for a developer that there is IListRidget (can be covered with documentation)
b) the methods in tableRidget are two complicated (need to many parameters) for a simple list

A list can do much less than a table, so we could have a much simplier API with less parameters and less methods for the List widget
Comment 1 Elias Volanakis CLA 2009-07-10 15:02:49 EDT
There is now an IListRidget that extends ITableRidget. This should address concern (a).

To address concern (b) IListRidget adds two simpler bind methods that do not require multiple columns or column headers:
void bindToModel(IObservableList rowObservables, Class<? extends Object> rowClass, String columnPropertyName);
void bindToModel(Object listHolder, String listPropertyName, Class<? extends Object> rowClass, String columnPropertyName);

Note that IListRidget inherits the other bind methods from ITableRidget, but I don't think there is anything to do about this.

Resolved.
Comment 2 Steffen Kriese CLA 2009-07-23 04:27:12 EDT
Created attachment 142355 [details]
added simplified bindToModel-Method

Added simplified bindToModel-Method to bind a list of Classes that don't conform to the Javabean standard and therefore don't have a property to use for binding. 

Example:
lass Model {
      List<String> items;
      public List<String> getItems() {
          return items;
      }
  }

IListRidget listRidget;
listRidget.bindToModel( new Model(), "items" );

In this case the toString-Method of String is used to render the items in the list.
Comment 3 Steffen Kriese CLA 2009-07-23 07:15:01 EDT
Created attachment 142365 [details]
simplified bindToModel-Method + TestCase
Comment 4 Christian Campo CLA 2009-07-23 07:26:58 EDT
patch applied thank you Steffen