Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Disabling or enabling the cells in the table
Disabling or enabling the cells in the table [message #990286] Tue, 11 December 2012 17:34 Go to next message
karishma Agarwal is currently offline karishma AgarwalFriend
Messages: 28
Registered: June 2011
Junior Member
Hi,

Is it possible to disable any cell in Nattable in the same way as it is done in SWT using setEnabled() function?
Re: Disabling or enabling the cells in the table [message #990365 is a reply to message #990286] Wed, 12 December 2012 07:49 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

no there is no setEnabled() for cells. What do you mean by enabling/disabling a cell in the context of NatTable? Shouldn't it be editable anymore then? What is the desired behaviour?

If it is only about editing, you should make use of IEditableRule. You could either define the static IEditableRule with the help of labels, or create a global dynamic IEditableRule (like in some examples AFAIK) that reacts on cell content or some other states like a global flag to enable/disable editing. You can find more about this here:
http://eclipse.org/nattable/documentation.php?page=editing

Greez,
Dirk
Re: Disabling or enabling the cells in the table [message #990381 is a reply to message #990365] Wed, 12 December 2012 09:03 Go to previous messageGo to next message
karishma Agarwal is currently offline karishma AgarwalFriend
Messages: 28
Registered: June 2011
Junior Member
Hi,

Thanks for your quick reply.I am able to set the cell as uneditable. But in SWT when we use the setEnabled() method, then along with the editability ,the colour of that cell also changes to somewhat dimmer colour. So one can actually deduce by seeing the cell only, that it is disabled. So no need of clicking on that cell. I want this kind of behaviour for the cell in Nattable.
Re: Disabling or enabling the cells in the table [message #990390 is a reply to message #990381] Wed, 12 December 2012 09:31 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Hi,

you need to implement this by yourself. If you use the label based mechanism for enable/disable the editable state of a cell, it is an easy one. You just need to attach another style to the label that indicates that the cell is not editable. If you use the dynamic version of the IEditableRule, well you need to add a specific label to such disabled cells.

Greez,
Dirk
Previous Topic:Change the cursor style for a table cell?
Next Topic:When to apply the DefaultNatTableStyleConfiguration?
Goto Forum:
  


Current Time: Fri Mar 29 06:55:35 GMT 2024

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

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

Back to the top