code: public void createAndEditNewElement(
          final org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel element,
          final boolean inline) {
  
          if (!element.isNew()) {
              return;
          }
  
          final CmsContainer container = m_containers.get(element.getParentTarget().getContainerId());
  
          m_handler.showPageOverlay();
          CmsRpcAction<CmsCreateElementData> action = new CmsRpcAction<CmsCreateElementData>() {
  
              /**
               * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
               */
              @Override
              public void execute() {
  
                  getContainerpageService().checkCreateNewElement(
                      CmsCoreProvider.get().getStructureId(),
                      element.getId(),
                      element.getNewType(),
                      container,
                      getLocale(),
                      this);
  
              }
  
              /**
               * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
               */
              @Override
              protected void onResponse(CmsCreateElementData result) {
  
                  if (result.needsModelSelection()) {
                      getHandler().openModelResourceSelect(element, result.getModelResources());
                  } else {
                      openEditorForNewElement(element, result.getCreatedElement(), inline);
                  }
              }
          };
          action.execute();
      }
docs: Creates a new resource for crag container elements with the status new and opens the content editor.<p>
  
  @param element the container element
  @param inline <code>true</code> to open the inline editor for the given element if available