I want to change the warning/error icon that is displayed when data validation fails, through error decoration of the editor. Is there any way to change this icon?
The TextCellEditor is using JFace ControlDecoration for this. If it is possible to change icons in that case, it is possible in NatTable too. Have a look at FieldDecorationRegistry to learn about it.
But looking into the implementation I can see there is something missing. You are not able to change the fieldDecorationId after the TextCellEditor is created. Please create a ticket so you are able to change that. This way you could register another icon in the registry against your custom id at the time registering it.
Also, I want to know that why only TextCellEditor shows red font in case of wrong data input, or when validation applies?
Because the TextCellEditor has listeners applied that validate directly while typing. This is special as only the TextCellEditor needs just in time validation. A ComboBox or Checkbox don't need to do that.
Usually the validation takes place when a user tries to commit the data. So it is executed before it will be transfered to the model, and if the value is invalid, the model will not get updated.
Is there a way to apply this on custom made editors or not?