mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Minor Inspect code
This commit is contained in:
@@ -31,7 +31,10 @@ import javax.imageio.ImageIO;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
|
||||
public class EduUtils {
|
||||
private EduUtils() {
|
||||
@@ -39,7 +42,7 @@ public class EduUtils {
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(EduUtils.class.getName());
|
||||
|
||||
public static final Comparator<StudyItem> INDEX_COMPARATOR = (o1, o2) -> o1.getIndex() - o2.getIndex();
|
||||
public static final Comparator<StudyItem> INDEX_COMPARATOR = Comparator.comparingInt(StudyItem::getIndex);
|
||||
|
||||
public static void enableAction(@NotNull final AnActionEvent event, boolean isEnable) {
|
||||
final Presentation presentation = event.getPresentation();
|
||||
|
||||
+1
-1
@@ -283,7 +283,7 @@ public class EduAdaptiveStepicConnector {
|
||||
final VirtualFile taskDir = VfsUtil
|
||||
.findFileByIoFile(new File(lessonDir.getCanonicalPath(), EduNames.TASK + unsolvedTask.getIndex()), true);
|
||||
final File resourceRoot = new File(course.getCourseDirectory(), lessonDir.getName());
|
||||
File newResourceRoot = null;
|
||||
File newResourceRoot;
|
||||
if (taskDir != null) {
|
||||
newResourceRoot = new File(resourceRoot, taskDir.getName());
|
||||
File[] filesInTask = newResourceRoot.listFiles();
|
||||
|
||||
+4
-1
@@ -122,6 +122,7 @@ public class StudyNewProjectPanel extends JPanel implements PanelWithAnchor {
|
||||
else {
|
||||
addCoursesToCombobox(myAvailableCourses);
|
||||
final CourseInfo selectedCourse = StudyUtils.getFirst(myAvailableCourses);
|
||||
if (selectedCourse == null) return;
|
||||
final String authorsString = Course.getAuthorsString(selectedCourse.getAuthors());
|
||||
myAuthorLabel.setText(!StringUtil.isEmptyOrSpaces(authorsString) ? "Author: " + authorsString : "");
|
||||
myDescriptionPane.setText(selectedCourse.getDescription());
|
||||
@@ -270,7 +271,9 @@ public class StudyNewProjectPanel extends JPanel implements PanelWithAnchor {
|
||||
myCoursesComboBox.removeAllItems();
|
||||
|
||||
addCoursesToCombobox(courses);
|
||||
myGenerator.setSelectedCourse(StudyUtils.getFirst(courses));
|
||||
final CourseInfo selectedCourse = StudyUtils.getFirst(courses);
|
||||
if (selectedCourse == null) return;
|
||||
myGenerator.setSelectedCourse(selectedCourse);
|
||||
|
||||
myGenerator.setCourses(courses);
|
||||
myAvailableCourses = courses;
|
||||
|
||||
Reference in New Issue
Block a user