code: public void removeElement(CmsContainerPageElementPanel elementWidget) {
  
          if (elementWidget.getInheritanceInfo().isNew()) {
              getHandler().removeElement(elementWidget, ElementRemoveMode.saveAndCheckReferences);
          } else {
              elementWidget.getInheritanceInfo().setVisible(false);
              elementWidget.addStyleName(HIDDEN_ELEMENT_CLASS);
              Element elementOverlay = DOM.createDiv();
              elementOverlay.setClassName(HIDDEN_ELEMENT_OVERLAY_CLASS);
              elementWidget.getElement().appendChild(elementOverlay);
              getGroupContainerWidget().add(elementWidget);
              updateButtonVisibility(elementWidget);
              m_showElementsButton.enable();
              getGroupContainerWidget().refreshHighlighting();
          }
          m_changedInheritanceInfo = true;
      }
docs: Either removes the locally configured element or hides the inherited element.<p>
  
  @param elementWidget the element widget