void () { String uri = generateFromUrl.getText(); boolean hasPrevious = (previousUri != null && previousUri.equals(uri)); final PsiFile psifile = findFile(uri); List<String> myRootValues; if (psifile == null) { configureComboBox(rootElementChooser, Collections.emptyList()); return; } final XmlTag rootTag = getRootTag(psifile); if (rootTag == null) { configureComboBox(rootElementChooser, Collections.emptyList()); rootElementChooser.setSelectedIndex(-1); previousUri = uri; return; } myRootValues = Xsd2InstanceUtils.addVariantsFromRootTag(rootTag); Object selectedItem = rootElementChooser.getSelectedItem(); configureComboBox(rootElementChooser, myRootValues); if (hasPrevious) { rootElementChooser.setSelectedItem(selectedItem); } else { rootElementChooser.setSelectedIndex(myRootValues.size() > 0 ? 0 : -1); } previousUri = uri; }