Commit 7fa31a76 authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

bugfix in editor creation for null children

parent 5918eb7f
......@@ -42,7 +42,7 @@ import org.openide.util.Lookup;
*/
public class DefaultObjectEditor extends AbstractOhEditor<Object, JComponent> {
private List<AbstractOhEditor> childrenEditors = new ArrayList<AbstractOhEditor>();
protected List<AbstractOhEditor> childrenEditors = new ArrayList<AbstractOhEditor>();
private JPanel pagePanel = new JPanel();
public DefaultObjectEditor(OhObjectComplex<?> object) {
......@@ -58,7 +58,7 @@ public class DefaultObjectEditor extends AbstractOhEditor<Object, JComponent> {
// TODO filter added types to retain only instanciable types
if (child.getValue() == null) {
// object has null value, so building specific panel for instanciating it
OhEditorPanel editor = new OhEditorPanel(object) {
OhEditorPanel editor = new OhEditorPanel(child) {
@Override
public Object getValue() {
......@@ -137,8 +137,10 @@ public class DefaultObjectEditor extends AbstractOhEditor<Object, JComponent> {
try {
editor.getOhObject().setValue(editor.getValue());
} catch (IllegalArgumentException ex) {
Exceptions.attachMessage(ex, "Error while trying to update the field " + editor.getOhObject().getName() + " in " + getOhObject().getName());
Exceptions.printStackTrace(ex);
} catch (IllegalAccessException ex) {
Exceptions.attachMessage(ex, "Error while trying to update the field " + editor.getOhObject().getName() + " in " + getOhObject().getName());
Exceptions.printStackTrace(ex);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment