See http://wiki.magnolia-cms.com/display/DEV/Concept+-+Light+dialogs#Concept-Lightdialogs-Refactoring