|
Re: Default Nattable, how to edit a cell [message #985784 is a reply to message #985675] |
Fri, 16 November 2012 07:56 |
Dirk Fauth Messages: 2903 Registered: July 2012 |
Senior Member |
|
|
Hi,
I looked at the Default NatTable example, and you are right, this example isn't editable. This is because the DefaultEditConfiguration sets the table to be never editable. AFAIK this was done because editing is almost a more complex operation then simply editing text. So you are forced to enable editing and therefore know what you are doing.
As explained in the documentation, editing is a configuration feature. http://eclipse.org/nattable/documentation.php?page=editing
So there is no additional layer. To make editing work with the default, you simply have to set the editing rule to ALWAYS_EDITABLE. As I like to use anonymous inner classes for simple configuration in NatTable, this would be some example code:
NatTable natTable = new NatTable(parent, false);
natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
natTable.addConfiguration(new AbstractRegistryConfiguration() {
public void configureRegistry(IConfigRegistry configRegistry) {
configRegistry.registerConfigAttribute(
EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
}
});
natTable.configure();
We will have a look at the example to make sure the description matches the features showed.
Thanks,
Dirk
|
|
|
Powered by
FUDForum. Page generated in 0.03628 seconds