Commit 9096facc authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

producer are now well fetched for trying to display appropriate editor

parent d8c28cc2
......@@ -30,6 +30,7 @@ import fr.cemagref.ohoui.structure.OhObjectCollection;
import fr.cemagref.ohoui.structure.OhObjectComplex;
import fr.cemagref.ohoui.ui.panels.AbstractOhEditor;
import fr.cemagref.ohoui.ui.panels.DefaultObjectEditor;
import fr.cemagref.ohoui.ui.panels.OhEditorProducer;
import fr.cemagref.ohoui.ui.panels.PanelsProvider;
import java.awt.CardLayout;
import java.awt.Dimension;
......@@ -103,8 +104,12 @@ public class NodesAndPanelsPanel extends JPanel implements ListSelectionListener
editorsCardLayout.show(editorsPanel, getCode(selectedObject));
} else {
// retrieve editor and put it in cache
OhEditorProducer editorProducer = PanelsProvider.getEditor(selectedObject);
AbstractOhEditor<Object, JComponent> editor = null;
if (selectedObject instanceof OhObjectCollection) {
if (editorProducer != null) {
editor = editorProducer.getEditor(selectedObject);
// TODO following tests should be avoided by presence of correct producer
} else if (selectedObject instanceof OhObjectCollection) {
// TODO bring an editor with a list and add/remove buttons
} else if (selectedObject instanceof OhObjectComplex) {
editor = new DefaultObjectEditor(selectedObject);
......
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