Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Default Nattable, how to edit a cell(Default Nattable, how to edit a cell)
Default Nattable, how to edit a cell [message #985675] Thu, 15 November 2012 16:28 Go to next message
Erik Vande Velde is currently offline Erik Vande VeldeFriend
Messages: 82
Registered: September 2012
I'm very impressed by the capabilties of nattable so far. Only one thing I don't understand: on the main page of the examples, default table, I read " EDIT A SELECTED CELL by typing F2 or edit directly by typing alphanumeric content; if multiple cells with the same ... ". In my case F2 doesn't do a thing, and just typing in a cell doesn't work. What am i Missing ??
Re: Default Nattable, how to edit a cell [message #985784 is a reply to message #985675] Fri, 16 November 2012 07:56 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2772
Registered: July 2012
Senior Member

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.

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) {
			EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);

We will have a look at the example to make sure the description matches the features showed.

Previous Topic:Moving rows in NatTable when its in sorted state
Next Topic:NatTable does not fit to empty space
Goto Forum:

Current Time: Sun Jan 26 12:21:47 GMT 2020

Powered by FUDForum. Page generated in 0.02086 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top