Panel existingPanel = renderedPanels.get(index);
if (existingPanel != null) {
if (!updating || selectedPanels.contains(existingPanel)) {
// update existing panel
existingPanel.update(canvasContent);
changeOrder(existingPanel, zorder);
}
} else {
String viewType = canvasContent.getManifestedViewType();
ComponentRegistry cr = ComponentRegistryAccess.getComponentRegistry();