ProjectStructureElement () { final OrderEntry entry = getSelectedEntry(); if (entry instanceof LibraryOrderEntry) { final Library library = ((LibraryOrderEntry)entry).getLibrary(); if (library != null) { return new LibraryProjectStructureElement(getContext(), library); } } else if (entry instanceof ModuleOrderEntry) { final Module module = ((ModuleOrderEntry)entry).getModule(); if (module != null) { return new ModuleProjectStructureElement(getContext(), module); } } else if (entry instanceof JdkOrderEntry) { final Sdk jdk = ((JdkOrderEntry)entry).getJdk(); if (jdk != null) { return new SdkProjectStructureElement(getContext(), jdk); } } return null; }