used lesson and task icons in course creator
@@ -8,11 +8,11 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.jetbrains.edu.EduNames;
|
||||
import com.jetbrains.edu.courseFormat.Course;
|
||||
import com.jetbrains.edu.courseFormat.Lesson;
|
||||
import com.jetbrains.edu.courseFormat.StudyItem;
|
||||
import icons.EducationalIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class CCCreateLesson extends CCCreateStudyItemActionBase {
|
||||
public static final String TITLE = "Create New " + EduNames.LESSON_TITLED;
|
||||
|
||||
public CCCreateLesson() {
|
||||
super(EduNames.LESSON_TITLED, TITLE, PlatformIcons.DIRECTORY_CLOSED_ICON);
|
||||
super(EduNames.LESSON_TITLED, TITLE, EducationalIcons.Lesson);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -14,7 +14,6 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.jetbrains.edu.EduNames;
|
||||
import com.jetbrains.edu.EduUtils;
|
||||
import com.jetbrains.edu.courseFormat.Course;
|
||||
@@ -23,6 +22,7 @@ import com.jetbrains.edu.courseFormat.StudyItem;
|
||||
import com.jetbrains.edu.courseFormat.Task;
|
||||
import com.jetbrains.edu.coursecreator.CCLanguageManager;
|
||||
import com.jetbrains.edu.coursecreator.CCUtils;
|
||||
import icons.EducationalIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CCCreateTask extends CCCreateStudyItemActionBase {
|
||||
public static final String TITLE = "Create New " + EduNames.TASK_TITLED;
|
||||
|
||||
public CCCreateTask() {
|
||||
super(EduNames.TASK_TITLED, TITLE, PlatformIcons.DIRECTORY_CLOSED_ICON);
|
||||
super(EduNames.TASK_TITLED, TITLE, EducationalIcons.Task);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.jetbrains.edu.courseFormat.Course;
|
||||
import com.jetbrains.edu.courseFormat.Lesson;
|
||||
import com.jetbrains.edu.courseFormat.Task;
|
||||
import com.jetbrains.edu.coursecreator.CCProjectService;
|
||||
import icons.EducationalIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CCDirectoryNode extends PsiDirectoryNode {
|
||||
@@ -28,23 +29,21 @@ public class CCDirectoryNode extends PsiDirectoryNode {
|
||||
|
||||
@Override
|
||||
protected void updateImpl(PresentationData data) {
|
||||
//TODO:change presentable name for files with suffix _answer
|
||||
|
||||
String valueName = myValue.getName();
|
||||
final CCProjectService service = CCProjectService.getInstance(myProject);
|
||||
final Course course = service.getCourse();
|
||||
if (course == null) return;
|
||||
if (myProject.getBaseDir().equals(myValue.getVirtualFile())) {
|
||||
data.clearText();
|
||||
data.addText(valueName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
data.addText(" (" + course.getName() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
data.addText(course.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
data.addText(" (" + valueName + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
return;
|
||||
}
|
||||
final Lesson lesson = course.getLesson(valueName);
|
||||
if (lesson != null) {
|
||||
data.clearText();
|
||||
data.addText(valueName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
data.addText(" (" + lesson.getName() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
data.setIcon(EducationalIcons.Lesson);
|
||||
data.addText(lesson.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@@ -55,8 +54,8 @@ public class CCDirectoryNode extends PsiDirectoryNode {
|
||||
final Task task = parentLesson.getTask(valueName);
|
||||
if (task != null) {
|
||||
data.clearText();
|
||||
data.addText(valueName, SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
data.addText(" (" + task.getName() + ")", SimpleTextAttributes.GRAYED_ATTRIBUTES);
|
||||
data.setIcon(EducationalIcons.Task);
|
||||
data.addText(task.getName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.jetbrains.edu.courseFormat.TaskFile;
|
||||
import com.jetbrains.edu.learning.StudyTaskManager;
|
||||
import com.jetbrains.edu.learning.StudyUtils;
|
||||
import com.jetbrains.edu.learning.courseFormat.StudyStatus;
|
||||
import icons.EducationalIcons;
|
||||
import icons.InteractiveLearningIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -98,7 +99,7 @@ public class StudyDirectoryNode extends PsiDirectoryNode {
|
||||
StudyStatus taskStatus = StudyTaskManager.getInstance(myProject).getStatus(lesson);
|
||||
switch (taskStatus) {
|
||||
case Unchecked: {
|
||||
updatePresentation(data, additionalName, JBColor.BLACK, InteractiveLearningIcons.Lesson);
|
||||
updatePresentation(data, additionalName, JBColor.BLACK, EducationalIcons.Lesson);
|
||||
break;
|
||||
}
|
||||
case Solved: {
|
||||
@@ -106,7 +107,7 @@ public class StudyDirectoryNode extends PsiDirectoryNode {
|
||||
break;
|
||||
}
|
||||
case Failed: {
|
||||
updatePresentation(data, additionalName, JBColor.RED, InteractiveLearningIcons.Lesson);
|
||||
updatePresentation(data, additionalName, JBColor.RED, EducationalIcons.Lesson);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +116,7 @@ public class StudyDirectoryNode extends PsiDirectoryNode {
|
||||
StudyStatus taskStatus = StudyTaskManager.getInstance(myProject).getStatus(task);
|
||||
switch (taskStatus) {
|
||||
case Unchecked: {
|
||||
updatePresentation(data, additionalName, JBColor.BLACK, InteractiveLearningIcons.Task);
|
||||
updatePresentation(data, additionalName, JBColor.BLACK, EducationalIcons.Task);
|
||||
break;
|
||||
}
|
||||
case Solved: {
|
||||
|
||||
@@ -14,13 +14,11 @@ public class InteractiveLearningIcons {
|
||||
}
|
||||
|
||||
public static final Icon InterpreterGear = load("/icons/com/jetbrains/edu/learning/interpreterGear.png"); // 16x16
|
||||
public static final Icon Lesson = load("/icons/com/jetbrains/edu/learning/Lesson.png"); // 16x16
|
||||
public static final Icon LessonCompl = load("/icons/com/jetbrains/edu/learning/LessonCompl.png"); // 16x16
|
||||
public static final Icon Prev = load("/icons/com/jetbrains/edu/learning/prev.png"); // 16x16
|
||||
public static final Icon Resolve = load("/icons/com/jetbrains/edu/learning/resolve.png"); // 16x16
|
||||
public static final Icon Sandbox = load("/icons/com/jetbrains/edu/learning/Sandbox.png"); // 16x16
|
||||
public static final Icon ShowHint = load("/icons/com/jetbrains/edu/learning/showHint.png"); // 16x16
|
||||
public static final Icon Task = load("/icons/com/jetbrains/edu/learning/Task.png"); // 16x16
|
||||
public static final Icon TaskCompl = load("/icons/com/jetbrains/edu/learning/TaskCompl.png"); // 16x16
|
||||
public static final Icon TaskProbl = load("/icons/com/jetbrains/edu/learning/TaskProbl.png"); // 16x16
|
||||
public static final Icon WatchInput = load("/icons/com/jetbrains/edu/learning/WatchInput.png"); // 24x24
|
||||
|
||||
|
Before Width: | Height: | Size: 285 B After Width: | Height: | Size: 285 B |
|
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 751 B |
|
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
|
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
|
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
|
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
@@ -0,0 +1,18 @@
|
||||
package icons;
|
||||
|
||||
import com.intellij.openapi.util.IconLoader;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* NOTE THIS FILE IS AUTO-GENERATED
|
||||
* DO NOT EDIT IT BY HAND, run build/scripts/icons.gant instead
|
||||
*/
|
||||
public class EducationalIcons {
|
||||
private static Icon load(String path) {
|
||||
return IconLoader.getIcon(path, EducationalIcons.class);
|
||||
}
|
||||
|
||||
public static final Icon Lesson = load("/icons/com/jetbrains/edu/learning/Lesson.png"); // 16x16
|
||||
public static final Icon Task = load("/icons/com/jetbrains/edu/learning/Task.png"); // 16x16
|
||||
}
|
||||