Menu

ManualAdvancedTables

Remo

Advanced Table Configuration

Class TableUtil hides the intricacies of eclipse api for configuring a table by doing all configuration stuff from a simple
and easy usable description of columns and their associated properties.

BUT: there are very few hooks provided where you can customize the behavior.

TableUtil creates the table and table viewer with columns defined by the ColumnConfiguration array passed.
It sets a standard ListContentProvider on the table and a combined label provider and cell modifier. The label provider
is responsible for rendering the element in table columns which are not edited; the cell modifier is responsible
for transferring values between a cell editor and the property.

The main work is done in the class PropertyLabelProviderAndCellModifier which combines label provider and cell modifier.
Values are converted using the same standard converters which are used for databinding, thus values should be displayed
in the same way as in text fields; you dont have to take care of this.

If you want to change the display or edit format of properties, you need to derive your own PropertyLabelProviderAndCellModifier
and overwrite methods like

  • getColumnText, getColumnImage (ITableLabelProvider interface)
  • getConverter if you need different converters for display or editing
  • canModify, getValue and modify for editing the value (ICellModifier methods)

You might want to set a different content provider or pass your own implementation of a label provider;
anyway, you need to know the Eclipse Table API very well to do so.


Related

Documentation: ManualCustomizingAndExtending

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.