String (JComboBox comboBox) { Object item = comboBox.getEditor().getItem(); if (item.toString().length() == 0) { final String text = projectDefaultAccessor.getText(myXsltFile.getChildComponent()); final VirtualFile file = VirtualFileManager.getInstance() .findFileByUrl(VfsUtil.pathToUrl(text.replace(File.separatorChar, '/'))); if (file != null && !file.isDirectory()) { final VirtualFile parent = file.getParent(); assert parent != null; return parent.getPresentableUrl(); } } return item.toString(); }