if(selection instanceof IStructuredSelection) {
currentSelection = (IStructuredSelection)selection;
if(currentSelection.getFirstElement() instanceof CardGroup) {
CardGroup group = (CardGroup)currentSelection.getFirstElement();
Deck deck = (Deck)group.getParent();
CardGroup next = deck.getNext(group);
state = ( next != null) && (next != deck.sideboard) && (group != deck.main);
}
action.setEnabled( state );
}