17
Introduction on Nebula NatTable By Dirk Fauth

Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Introduction on

Nebula NatTable

By Dirk Fauth

Page 2: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Dirk FauthSenior Consultant

BeOne Stuttgart GmbH

Nebula NatTable Commiter

[email protected]

Twitter: fipro78

2012-10-24 2 / 17

Page 3: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Agenda

• What‘s NatTable?

• Other tables/trees/grids

• NatTable Architecture

– Data access

– Configuration

– Supported Functions

• Roadmap

• Further information

2012-10-24 3 / 17

Page 4: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

What‘s NatTable?

• N(ot) a(nother) t(able)

• Framework for building tables/grids/trees

• Designed to handle large datasets

• Provides a lot of functionality out of the box

2012-10-24 4 / 17

Page 5: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Some examples

2012-10-24 5 / 17

Page 6: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Other tables/trees/grids

SWT/JFace

Nebula Grid

Nebula XViewer

KTableinactive since 2009

Jaret tableinactive since 2010

2012-10-24 6 / 17

Page 7: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Other tables/trees/grids

TableViewer viewer = new TableViewer(parent,

SWT.BORDER|SWT.H_SCROLL|SWT.V_SCROLL);

...

TableViewerColumn column =

new TableViewerColumn(viewer, SWT.NONE);

column.getColumn().setText("Firstname");

column.getColumn().setWidth(100);

column.setLabelProvider(new CellLabelProvider() {

...

});

column.setEditingSupport(new MyEditingSupport());

...

2012-10-24 7 / 17

Page 8: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Other tables/trees/grids

• Created column by column

• Several objects for every column

– Column object, LabelProvider, (EditingSupport)

• Using native OS widgets

Firstname Lastname Married

Gender

2012-10-24 8 / 17

Page 9: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Creating a NatTable

String[] propertyNames = {"firstName", "lastName", "married"};

Map<String, String> propertyToLabelMap =

new HashMap<String, String>();

propertyToLabelMap.put("firstName", "Firstname");

propertyToLabelMap.put("lastName", "Lastname");

propertyToLabelMap.put("married", "Married");

DefaultGridLayer grid =

new DefaultGridLayer(

persons, propertyNames, propertyToLabelMap);

NatTable natTable = new NatTable(parent, grid);

...

2012-10-24 9 / 17

Page 10: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

NatTable Architecture

2012-10-24 10 / 17

Page 11: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Data access

• DataLayer

– IDataProvider (e.g. ListDataProvider)• IColumnAccessor (e.g. ReflectiveColumnPropertyAccessor)

• No databinding support at the moment, as

data is retrieved/modified directly

• GlazedLists support

2012-10-24 11 / 17

Page 12: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Data access

2012-10-24 12 / 17

public interface IDataProvider {

Object getDataValue(int columnIndex, int rowIndex);

void setDataValue(int columnIndex, int rowIndex,

Object newValue);

int getColumnCount();

int getRowCount();

}

public interface IColumnAccessor<T> {

Object getDataValue(T rowObject, int columnIndex);

void setDataValue(T rowObject, int columnIndex,

Object newValue);

int getColumnCount();

}

Page 13: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Configuration

• ConfigRegistry per NatTable instance

– Styling

• Painters

• Styles

– Bindings

• Key bindings

• Mouse bindings

– Conditional configuration by labels

• Separation of data and rendering/styling

2012-10-24 13 / 17

Page 14: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Supported Functions

Column Reordering

Sorting

Filtering

Blinking Updates

Summary Row

Column Hide/Show

Editing

Selection

Freezing

Column/Row Grouping

Table/Grid/Tree

Excel Export

(Conditional) Styling

Context Menus

Custom Bindings/Commands

Percentage Sizing

Editing Rules

Checkbox Editor

Combobox Editor

Text EditorPassword Editor

2012-10-24 14 / 17

Page 15: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Nebula NatTable 1.0

• Smooth Scrolling

• Simplification of NatTable configuration

• Refactoring of column and row grouping

• (Refactoring of event handling)

• Further enhancements and bugfixes

2012-10-24 15 / 17

Page 16: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Nebula NatTable 2.x

• Upgrade dependencies to Eclipse 4

• Introducing Dependency Injection

• Introducing EMF based configuration

• CSS styling

• Support different rendering engines

2012-10-24 16 / 17

Page 17: Introduction on Nebula NatTable - EclipseCon 2020...Data access 2012-10-24 12/ 17 public interface IDataProvider {Object getDataValue(int columnIndex, int rowIndex); void setDataValue(int

Further Information

• Nebula NatTable Website

http://eclipse.org/nattable/

• Nebula NatTable Forum

http://www.eclipse.org/forums/index.php?t=thread&frm_id=

240

• Mailing List

[email protected]

• Articles (German)

http://www.beone-group.com/publikationen.html

2012-10-24 17 / 17