public void selectionChanged(SelectionChangedEvent event) {
Object obj = ((IStructuredSelection) event.getSelection()).getFirstElement();
if (obj instanceof Document) {
CardTemplate card = CardPool.instance().lookup((Document)obj);
updateCard(card);
} else if (obj instanceof CardTemplate)
updateCard((CardTemplate) obj);
else if (obj instanceof Card)
updateCard(((Card) obj).getTemplate());