Module () { final Module selectedItem = content.moduleCombo.getSelectedModule(); if (selectedItem != null) { return selectedItem; } final Module[] modules = ModuleManager.getInstance(myProject).getModules(); if (modules.length == 1) { return modules[0]; } return null; }