private SelectedElementInfo(@Nullable E element) {
   myElement = element;
   if (myElement != null) {
     //noinspection unchecked
     myCurrentPanel = element.getType().createElementPropertiesPanel(myElement, myContext);
     myPropertiesPanel.removeAll();
     if (myCurrentPanel != null) {
       myPropertiesPanel.add(
           BorderLayout.CENTER,
           ScrollPaneFactory.createScrollPane(myCurrentPanel.createComponent(), true));
       myCurrentPanel.reset();
       myPropertiesPanel.revalidate();
     }
   }
 }
 public void save() {
   if (myCurrentPanel != null && myCurrentPanel.isModified()) {
     editLayout(
         new Runnable() {
           @Override
           public void run() {
             myCurrentPanel.apply();
           }
         });
   }
 }
 public void resetElementProperties() {
   final PackagingElementPropertiesPanel panel = mySelectedElementInfo.myCurrentPanel;
   if (panel != null) {
     panel.reset();
   }
 }
 public boolean isPropertiesModified() {
   final PackagingElementPropertiesPanel panel = mySelectedElementInfo.myCurrentPanel;
   return panel != null && panel.isModified();
 }