package org.openlca.app.viewers.table.modify;

public abstract class TextCellModifier<T> implements ICellModifier<T> {

	@Override
	public boolean canModify(T element) {
		return true;
	}

	@Override
	public final ICellModifier.CellEditingType getCellEditingType() {
		return CellEditingType.TEXTBOX;
	}

	@Override
	public final Object[] getValues(T element) {
		return null;
	}

	@Override
	public String[] getStringValues(T element) {
		return null;
	}

	@Override
	public Object getValue(T element) {
		return getText(element);
	}

	@Override
	public void modify(T element, Object value) {
		setText(element, value != null ? value.toString() : null);
	}

	protected abstract String getText(T element);

	protected abstract void setText(T element, String text);

}

@@ -636,17 +636,22 @@
 element,
- 
+%0D%0A%09%09%09%09
 value !=
@@ -658,16 +658,17 @@
  null ? 
+!
 value.to
@@ -675,16 +675,59 @@
 String()
+.isEmpty() ? value.toString()%0D%0A%09%09%09%09%09%09: null
  : null)

when calling setText empty string will be given as null