Esempio n. 1
0
 protected PanelElementAbstract createPanelElement(BasicDBObject DBO, int idx) {
   T t;
   try {
     t = clazz.newInstance();
     t.setIdx(idx);
     t.setDisplayer(panelDisplayer);
     t.setData(DBO);
     t.initPanel();
     PanelElementAbstract b;
     if (t instanceof ParameterPanel) {
       b = new PanelElementMono((ParameterPanel) t, this, maxNb > 1 && idx >= minNb, idx);
     } else {
       b =
           new PanelElementPlugin(
               (ParameterPanelPlugin) t, this, maxNb > 1 && idx >= minNb, enableTest);
       if (template != null && idx < template.panelElements.size())
         ((PanelElementPlugin) b)
             .setTemplate((PanelElementPlugin) template.panelElements.get(idx));
     }
     // System.out.println("panelElement null:"+(b==null)+ " idx:"+idx+ " "+DBO);
     return b;
   } catch (Exception e) {
     exceptionPrinter.print(e, "", Core.GUIMode);
   }
   return null;
 }