void (@Nullable String packageName) { PackagesModel packagesModel = ObjectUtils.tryCast(myPackages.getModel(), PackagesModel.class); if (packageName == null || packagesModel == null) { return; } for (int i = 0; i < packagesModel.getSize(); i++) { RepoPackage repoPackage = packagesModel.getElementAt(i); if (packageName.equals(repoPackage.getName())) { myPackages.setSelectedIndex(i); myPackages.ensureIndexIsVisible(i); break; } } }