boolean retValue = canContainInRom( slotId, element.getDefn( ) ); if ( !retValue )
List errors = checkContainmentContext( module, slotId, element ); if ( !errors.isEmpty( ) )
	public final boolean canContain( Module module, int slotId,			DesignElement element )	{		boolean retValue = canContainInRom( slotId, element.getDefn( ) );		if ( !retValue )			return false;		// if this element can not be contained in the module, return false;		// such		// as, template elements can not be contained in the libraries, so		// either a template table or a real tabel with a template image in one		// cell of it can never be contained in a libraries		if ( !canContainTemplateElement( module, slotId, element ) )			return false;		// if the root of element is included by report/library. Do not allow		// drop.		if ( isRootIncludedByModule( ) )			return false;		// Can not change the structure of child element or a virtual element(		// inside the child ).		if ( isVirtualElement( ) || getExtendsName( ) != null )			return false;		// special cases check table header containment.		DesignElement tmpContainer = this;		while ( tmpContainer != null )		{			if ( tmpContainer instanceof ListingElement					|| tmpContainer instanceof Theme					|| tmpContainer instanceof MasterPage )			{				List errors = tmpContainer.checkContent( module, this, slotId,						element );				return errors.isEmpty( );			}			tmpContainer = tmpContainer.getContainer( );		}		return retValue;	}