public Component newInstance(Class<? extends Component> cls) { final Object curInfo = ComponentsCtrl.getCurrentInfo(); boolean bSet = true; if (curInfo instanceof ComponentInfo) { bSet = ((ComponentInfo) curInfo).getComponentDefinition() != this; } else if (curInfo instanceof ShadowInfo) { bSet = ((ShadowInfo) curInfo).getComponentDefinition() != this; } if (bSet) ComponentsCtrl.setCurrentInfo(this); final Component comp; try { comp = cls.newInstance(); } catch (Exception ex) { throw UiException.Aide.wrap(ex); } finally { if (bSet) ComponentsCtrl.setCurrentInfo((ComponentDefinition) null); } return comp; }
} else if (curInfo instanceof ShadowInfo) { final ShadowInfo compInfo = (ShadowInfo) curInfo; _def = compInfo.getComponentDefinition(); addSharedAnnotationMap(_def.getAnnotationMap()); addSharedAnnotationMap(compInfo.getAnnotationMap());