code: public void removeElement(
          org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel dragElement,
          ElementRemoveMode removeMode) {
  
          if (isGroupcontainerEditing()) {
              dragElement.removeFromParent();
              if (!getGroupcontainer().iterator().hasNext()) {
                  // group-container is empty, mark it
                  getGroupcontainer().addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer());
              }
              getGroupcontainer().refreshHighlighting();
          } else {
              final String id = dragElement.getId();
              if (id != null) {
                  addToRecentList(id, null);
              }
  
              I_CmsDropContainer container = dragElement.getParentTarget();
              switch (removeMode) {
                  case saveAndCheckReferences:
                      dragElement.removeFromParent();
                      if (container instanceof CmsContainerPageContainer) {
                          ((CmsContainerPageContainer)container).checkEmptyContainers();
                      }
                      cleanUpContainers();
                      Runnable checkReferencesAction = new Runnable() {
  
                          public void run() {
  
                              checkReferencesToRemovedElement(id);
                          }
                      };
                      setPageChanged(checkReferencesAction);
                      break;
                  case confirmRemove:
                      handleConfirmRemove(dragElement);
                      break;
                  case silent:
                  default:
                      dragElement.removeFromParent();
                      if (container instanceof CmsContainerPageContainer) {
                          ((CmsContainerPageContainer)container).checkEmptyContainers();
                      }
                      cleanUpContainers();
                      setPageChanged();
                      break;
              }
          }
      }
docs: Removes the given container element from its parent container.<p>
  
  @param dragElement the element to remove
  @param removeMode the remove mode