class AttributeTypesSupportCellEditor extends DefaultCellEditor {

    private static final Border RED_BORDER = new LineBorder(Color.red);

    private final GraphModelProvider graphModelProvider;

    private final JTextField textField;
    private final Border originalBorder;
    private final Class<?> typeClass;
    private final boolean isTimestampSetType;
    private final boolean isTimestampMapType;
    private final boolean isIntervalSetType;
    private final boolean isIntervalMapType;
    private final boolean isArrayType;
    private final boolean isDecimalType;

    public AttributeTypesSupportCellEditor(GraphModelProvider graphModelProvider, Class<?> typeClass) {
        super(new JTextField());
        this.graphModelProvider = graphModelProvider;
        this.typeClass = typeClass;

        textField = new JTextField();
        originalBorder = textField.getBorder();

        isTimestampSetType = TimestampSet.class.isAssignableFrom(typeClass);
        isTimestampMapType = TimestampMap.class.isAssignableFrom(typeClass);
        isIntervalSetType = IntervalSet.class.isAssignableFrom(typeClass);
        isIntervalMapType = IntervalMap.class.isAssignableFrom(typeClass);
        isArrayType = typeClass.isArray();
        isDecimalType = typeClass.equals(Double.class)
            || typeClass.equals(double.class)
            || typeClass.equals(Float.class)
            || typeClass.equals(float.class);
    }

    @Override
    public boolean stopCellEditing() {
        String value = getCellEditorValue().toString();
        if (!value.trim().isEmpty()) {
            try {
                AttributeUtils.parse(value, typeClass);
            } catch (Exception e) {
                textField.setBorder(RED_BORDER);
                return false;//Invalid value for type
            }
        }

        return super.stopCellEditing();
    }

    @Override
    public Object getCellEditorValue() {
        return textField.getText();
    }

    @Override
    public Component getTableCellEditorComponent(JTable table,
                                                 Object value, boolean isSelected, int row, int column) {<FILL_FUNCTION_BODY>}
}


        TimeFormat timeFormat = graphModelProvider.getGraphModel().getTimeFormat();
        DateTimeZone timeZone = graphModelProvider.getGraphModel().getTimeZone();

        String valueStr;
        if (value == null) {
            valueStr = "";
        } else if (isTimestampSetType) {
            valueStr = ((TimestampSet) value).toString(timeFormat, timeZone);
        } else if (isTimestampMapType) {
            valueStr = ((TimestampMap) value).toString(timeFormat, timeZone);
        } else if (isIntervalSetType) {
            valueStr = ((IntervalSet) value).toString(timeFormat, timeZone);
        } else if (isIntervalMapType) {
            valueStr = ((IntervalMap) value).toString(timeFormat, timeZone);
        } else if (isArrayType) {
            valueStr = AttributeUtils.printArray(value);
        } else {
            valueStr = AttributeUtils.print(value, timeFormat, timeZone);
        }

        textField.setBorder(originalBorder);
        textField.setEditable(true);
        textField.setText(valueStr);
        return textField;
    
<methods>public void <init>(javax.swing.JTextField) ,public void <init>(javax.swing.JCheckBox) ,public void <init>(JComboBox<?>) ,public void cancelCellEditing() ,public java.lang.Object getCellEditorValue() ,public int getClickCountToStart() ,public java.awt.Component getComponent() ,public java.awt.Component getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int) ,public java.awt.Component getTreeCellEditorComponent(javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, int) ,public boolean isCellEditable(java.util.EventObject) ,public void setClickCountToStart(int) ,public boolean shouldSelectCell(java.util.EventObject) ,public boolean stopCellEditing() <variables>protected int clickCountToStart,protected javax.swing.DefaultCellEditor.EditorDelegate delegate,protected javax.swing.JComponent editorComponent