mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EDU-230 Move show hint action to editor
This commit is contained in:
@@ -19,7 +19,7 @@ public class StudyIcons {
|
||||
public static final Icon Prev = load("/icons/com/jetbrains/python/edu/prev.png"); // 16x16
|
||||
public static final Icon Resolve = load("/icons/com/jetbrains/python/edu/resolve.png"); // 16x16
|
||||
public static final Icon Sandbox = load("/icons/com/jetbrains/python/edu/Sandbox.png"); // 16x16
|
||||
public static final Icon ShowHint = load("/icons/com/jetbrains/python/edu/showHint.png"); // 24x24
|
||||
public static final Icon ShowHint = load("/icons/com/jetbrains/python/edu/showHint.png"); // 16x16
|
||||
public static final Icon Task = load("/icons/com/jetbrains/python/edu/Task.png"); // 16x16
|
||||
public static final Icon TaskCompl = load("/icons/com/jetbrains/python/edu/TaskCompl.png"); // 16x16
|
||||
public static final Icon TaskProbl = load("/icons/com/jetbrains/python/edu/TaskProbl.png"); // 16x16
|
||||
|
||||
@@ -55,11 +55,6 @@
|
||||
<action id="WatchInputAction" class="com.jetbrains.python.edu.actions.StudyEditInputAction" text="WatchInputAction"
|
||||
description="watch input"/>
|
||||
<action id="StudyRunAction" class="com.jetbrains.python.edu.actions.StudyRunAction" text="StudyRunAction" description="run your code"/>
|
||||
<action id="ShowHintAction" class="com.jetbrains.python.edu.actions.StudyShowHintAction" text="Show hint"
|
||||
description="show hint">
|
||||
<add-to-group group-id="MainToolBar" anchor="last"/>
|
||||
</action>
|
||||
|
||||
<action id="WelcomeScreen.PythonIntro" class="com.jetbrains.python.edu.actions.StudyIntroductionCourseAction" icon="StudyIcons.EducationalProjectType">
|
||||
<add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
|
||||
</action>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 410 B |
Binary file not shown.
|
After Width: | Height: | Size: 871 B |
+5
-1
@@ -32,11 +32,15 @@ public class StudyShowHintAction extends DumbAwareAction {
|
||||
super("Show hint", "Show hint", StudyIcons.ShowHint);
|
||||
}
|
||||
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
final Project project = e.getProject();
|
||||
if (project == null) {
|
||||
return;
|
||||
}
|
||||
showHint(project);
|
||||
}
|
||||
|
||||
public static void showHint(Project project) {
|
||||
Course course = StudyTaskManager.getInstance(project).getCourse();
|
||||
if (course == null) {
|
||||
return;
|
||||
|
||||
@@ -66,6 +66,7 @@ public class StudyEditor implements TextEditor {
|
||||
private JButton myRefreshButton;
|
||||
private static final Map<Document, StudyDocumentListener> myDocumentListeners = new HashMap<Document, StudyDocumentListener>();
|
||||
private final Project myProject;
|
||||
private JButton myShowHintButton;
|
||||
|
||||
public JButton getCheckButton() {
|
||||
return myCheckButton;
|
||||
@@ -196,6 +197,7 @@ public class StudyEditor implements TextEditor {
|
||||
myPrevTaskButton = addButton(taskActionsPanel, "Prev Task", StudyIcons.Prev);
|
||||
myNextTaskButton = addButton(taskActionsPanel, "Next Task", AllIcons.Actions.Forward);
|
||||
myRefreshButton = addButton(taskActionsPanel, "Start task again", AllIcons.Actions.Refresh);
|
||||
myShowHintButton = addButton(taskActionsPanel, "Show hint", StudyIcons.ShowHint);
|
||||
if (!taskFile.getTask().getUserTests().isEmpty()) {
|
||||
JButton runButton = addButton(taskActionsPanel, "Run", AllIcons.General.Run);
|
||||
runButton.addActionListener(new ActionListener() {
|
||||
@@ -242,9 +244,14 @@ public class StudyEditor implements TextEditor {
|
||||
myRefreshButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
StudyRefreshTaskFileAction studyRefreshTaskAction =
|
||||
(StudyRefreshTaskFileAction)ActionManager.getInstance().getAction("RefreshTaskAction");
|
||||
studyRefreshTaskAction.refresh(myProject);
|
||||
StudyRefreshTaskFileAction.refresh(myProject);
|
||||
}
|
||||
});
|
||||
|
||||
myShowHintButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
StudyShowHintAction.showHint(myProject);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user