I want to build a very small Pi case including a 2TB hard drive, with only a single power cable for both the drive and the Pi. It looks like a good option is an enclosure such as this, designed for two 3.5" SATA drives. How can I power the Pi from something like this? Ideally, the enclosure's power button would trigger a shutdown sequence.
It depends on the internals of the enclosure. If it provides 5v power through the USB cable, this should power the Pi. (I have reservations about the wisdom of allowing the Pi to be powered through its hub, but that is the way the rev B is designed). You would need to verify the power feed, and its capacity.
The second part of your question is not feasible. You would need to initiate a Pi shutdown sequence, but need to maintain power until this is finished. Not impossible, but not really practicable.
These are 3.5" drives that must use a power pack. USB power is not sufficient. As it will use a typical molex connector to power the drive you can easily tap into 5v rail.
Its unclear if you want to put the Pi inside there? But either way you can bring the +5 and GND out side too by splicing the cable. Usually the power pack is rated for peak plus a bit. Hard drives will only peak at spin up then it uses allot less power, leaving allot of room for the Pi.
Doing the power button is a competently different story. As it stands if you turn it off the Pi will turn off. That should be a different question because I can think of atleast 3 ways of doing it.