Module () { final Object selected = getModuleStructureConfigurable().getSelectedObject(); if (selected instanceof Module) { return (Module)selected; } if (selected instanceof Facet) { return ((Facet<?>)selected).getModule(); } return null; }