Author: tchemit Date: 2013-03-15 12:55:51 +0100 (Fri, 15 Mar 2013) New Revision: 2628 Url: http://nuiton.org/projects/jaxx/repository/revisions/2628 Log: fixes #2599: [ConfigUI] Can not edit an option of type *char* Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableEditor.java Modified: trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableEditor.java =================================================================== --- trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableEditor.java 2013-03-15 06:53:40 UTC (rev 2627) +++ trunk/jaxx-config/src/main/java/jaxx/runtime/swing/config/ConfigTableEditor.java 2013-03-15 11:55:51 UTC (rev 2628) @@ -26,13 +26,13 @@ import com.google.common.io.Files; import jaxx.runtime.swing.JAXXWidgetUtil; +import jaxx.runtime.swing.config.model.ConfigTableModel; +import jaxx.runtime.swing.config.model.OptionModel; import jaxx.runtime.swing.editor.ClassCellEditor; import jaxx.runtime.swing.editor.ColorCellEditor; import jaxx.runtime.swing.editor.EnumEditor; import jaxx.runtime.swing.editor.LocaleEditor; import jaxx.runtime.swing.editor.cell.FileCellEditor; -import jaxx.runtime.swing.config.model.ConfigTableModel; -import jaxx.runtime.swing.config.model.OptionModel; import org.apache.commons.lang3.StringUtils; import javax.swing.DefaultCellEditor; @@ -50,11 +50,12 @@ * L'éditeur des valeurs des propriétés d'une configuration * * @author tchemit <chemit@codelutin.com> - * @since 2.5.11 + * @since 2.5.11 */ public class ConfigTableEditor implements TableCellEditor { protected TableCellEditor delegate; + protected ConfigTableModel model; public ConfigTableEditor(ConfigTableModel model) { @@ -110,6 +111,9 @@ protected TableCellEditor findDelegate(JTable table, OptionModel option) { Class<?> type = option.getType(); + if (char.class.equals(type)) { + type = String.class; + } TableCellEditor editor = table.getDefaultEditor(type); TableCellEditor defaultEditor = table.getDefaultEditor(Object.class); // always Search from option.getEditor() and store editor as cache @@ -126,16 +130,16 @@ } else if (type.equals(Class.class)) { editor = new ClassCellEditor(); - } else if (type.equals(File.class)){ + } else if (type.equals(File.class)) { editor = new FileCellEditorWithExtDetector(); - } else if (type.equals(KeyStroke.class)){ + } else if (type.equals(KeyStroke.class)) { editor = JAXXWidgetUtil.newKeyStrokeTableCellEditor(); } else if (type.equals(Locale.class)) { editor = new DefaultCellEditor(LocaleEditor.newEditor()); - } else if (type.equals(Color.class)) { + } else if (type.equals(Color.class)) { editor = new ColorCellEditor(); } else {