NebulaGridWrapper helps to represent list of objects used by Nebula Grid.
You have to write how to represent the object in the table row:
public static class SimpleNodeFactory extends NodeFactory { @Override public void setNodeData(Node node, final Object object) { Map values = new HashMap(); values.put("name", new CellProperty(((PeopleDTO) object).getName())); values.put("age", new CellProperty(((PeopleDTO) object).getAge())); node.setCellPropertiesMap(values); } }
and create Grid:
List columnsList = ColumnsFactory.createColumns(new String[] {"name", "age"}); GridTable grid = new GridTable(shell, GridTable.DEFAULT_STYLE, new SimpleNodeFactory(), columnsList);
After that you can simply add data to the grid:
grid.setData(DataProvider.getPeople());
Supported features:
- Color and font of columns and cells
- Tooltips
- Click and selection listeners
- Single- and multiselect rows
- Editors in cells
- Images in cells