4 Answers
4

If you don't want to set up a Sticky Piston system to retract and extend the Bookshelves, you can place a torch or place water in the area where the Bookshelves are. For some reason, this disables all of the Bookshelves and makes the Enchanting Table act as if there aren't any Bookshelves around it.

@Poma: You are correct about the dimensions, that was a typo. As for the pistons, yes, but slimeballs are fairly easy to obtain with a farm. Also, this is a better solution in some cases since it can disable the shelves selectively.
–
Alexis KingDec 25 '11 at 20:05

1

I'll stick with Red3yz's mechanism. It also can turn off bookshelves selectively and requires only 7 non-sticky pistons (if sand or gravel is placed on top). I prefer simple solutions :)
–
PomaDec 26 '11 at 10:56

As Jake King suggested, you can use sticky pistons, and I've made a video to explain (made it before the first answer, but it was uploading too long).

It isn't that hard, you'll need a piston for every bookshelf, so it's 30 pieces. The tricky part is to get 30 slimeballs, but you can farm them. If you are okay to use an utility - you can find it here, but if you aren't - just explore some caves close to the bedrock and remember the place, where you have seen any slimes. They spawn in certain 16x16 chunks, so you'll have to dig out a big ~32x32 room somewhere between levels 10-40, they'll spawn there eventually. Good video tutorial and text tutorial.

UPD: I've upgraded my system. Nothing complicated, but it gives access to any enchantment level (not just the lowest and the highest). Still uses 30 pistons, but I'm an aesthete and I don't like how other solutions look/work.