EDU-83 Add shortcut text to the next/prev/check button tooltip
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Wed, 22 Oct 2014 11:15:14 +0000 (15:15 +0400)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Wed, 22 Oct 2014 11:15:14 +0000 (15:15 +0400)
python/edu/learn-python/resources/META-INF/plugin.xml
python/edu/learn-python/src/com/jetbrains/python/edu/StudyInstructionPainter.java
python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyCheckAction.java
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextStudyTaskAction.java
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyNextWindowAction.java
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPrevWindowAction.java
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyPreviousStudyTaskAction.java
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyRefreshTaskFileAction.java
python/edu/learn-python/src/com/jetbrains/python/edu/editor/StudyEditor.java

index 59457f3a1a9592de4306d95bbba3b9ffb39b0248..620796a8435cac16e589464645298e7f82a0fcda 100644 (file)
@@ -54,6 +54,8 @@
             description="Refresh current task"/>
     <action id="WatchInputAction" class="com.jetbrains.python.edu.actions.StudyEditInputAction" text="WatchInputAction"
             description="watch input"/>
+    <action id="ShowHintAction" class="com.jetbrains.python.edu.actions.StudyShowHintAction" text="Show hint"
+            description="Show hint"/>
     <action id="StudyRunAction" class="com.jetbrains.python.edu.actions.StudyRunAction" text="StudyRunAction" description="run your code"/>
     <action id="WelcomeScreen.PythonIntro" class="com.jetbrains.python.edu.actions.StudyIntroductionCourseAction" icon="StudyIcons.EducationalProjectType">
       <add-to-group group-id="WelcomeScreen.QuickStart" anchor="first"/>
index 96a44b2ee66a2a459e90dc1657ee0c1374a15203..4fa323172bcccfa3efe71a95f6a9d8408df6d0d9 100644 (file)
@@ -28,7 +28,10 @@ public class StudyInstructionPainter extends EditorEmptyTextPainter {
 
     painter.appendLine("PyCharm Educational Edition").underlined(new JBColor(Gray._150, Gray._180));
     painter.appendLine("Navigate to the next task window with Ctrl + Enter").smaller().withBullet();
-    painter.appendLine("Navigate between task windows with Ctrl + < and Ctrl + >").smaller().withBullet();
+    painter.appendLine("Navigate between task windows with Ctrl + Shift + < and Ctrl + Shift + >").smaller().withBullet();
+    painter.appendLine("Navigate between tasks with Ctrl + < and Ctrl + >").smaller().withBullet();
+    painter.appendLine("Reset current task file with Ctrl + Shift + X").smaller().withBullet();
+    painter.appendLine("Check task with Alt + Ctrl + Enter").smaller().withBullet();
     painter.appendLine("Get hint for the task window using Ctrl + 7").smaller().withBullet();
     painter.appendLine("To see your progress open the 'Course Description' panel").smaller().withBullet();
                        painter.draw(g, new PairFunction<Integer, Integer, Couple<Integer>>() {
index 3013fbcb05d30dc4272175a927a44ec43d3a71f7..9b935504bd5cc1685eccc40a5762120acf6a32e4 100644 (file)
@@ -20,9 +20,7 @@ import com.intellij.openapi.vfs.VirtualFileEvent;
 import com.intellij.openapi.vfs.VirtualFileManager;
 import com.intellij.openapi.wm.*;
 import com.intellij.util.xmlb.XmlSerializer;
-import com.jetbrains.python.edu.actions.StudyNextWindowAction;
-import com.jetbrains.python.edu.actions.StudyPrevWindowAction;
-import com.jetbrains.python.edu.actions.StudyShowHintAction;
+import com.jetbrains.python.edu.actions.*;
 import com.jetbrains.python.edu.course.Course;
 import com.jetbrains.python.edu.course.Lesson;
 import com.jetbrains.python.edu.course.Task;
@@ -155,6 +153,10 @@ public class StudyTaskManager implements ProjectComponent, PersistentStateCompon
               addShortcut(StudyPrevWindowAction.SHORTCUT, StudyPrevWindowAction.ACTION_ID);
               addShortcut(StudyShowHintAction.SHORTCUT, StudyShowHintAction.ACTION_ID);
               addShortcut(StudyNextWindowAction.SHORTCUT2, StudyNextWindowAction.ACTION_ID);
+              addShortcut(StudyCheckAction.SHORTCUT, StudyCheckAction.ACTION_ID);
+              addShortcut(StudyNextStudyTaskAction.SHORTCUT, StudyNextStudyTaskAction.ACTION_ID);
+              addShortcut(StudyPreviousStudyTaskAction.SHORTCUT, StudyPreviousStudyTaskAction.ACTION_ID);
+              addShortcut(StudyRefreshTaskFileAction.SHORTCUT, StudyRefreshTaskFileAction.ACTION_ID);
             }
           }
         });
index 9741a240b0ec8031b7c5d9721cc2314e9d8d8ae4..b5f4c003ffe8d4ec55d060f15425856de868d3cc 100644 (file)
@@ -41,6 +41,8 @@ public class StudyCheckAction extends DumbAwareAction {
 
   private static final Logger LOG = Logger.getInstance(StudyCheckAction.class.getName());
   private static final String ANSWERS_POSTFIX = "_answers.py";
+  public static final  String ACTION_ID = "CheckAction";
+  public static final String SHORTCUT = "ctrl alt pressed ENTER";
 
 
   private static void flushWindows(@NotNull final Task task, @NotNull final VirtualFile taskDir) {
index 3c971c3fe15e29ad8e75eec7102e25b707cda909..27edf22529cd66230185e7fa752b775ae0e3f02e 100644 (file)
@@ -8,6 +8,9 @@ import javax.swing.*;
 
 public class StudyNextStudyTaskAction extends StudyTaskNavigationAction {
 
+  public static final String ACTION_ID = "NextTaskAction";
+  public static final String SHORTCUT = "ctrl pressed PERIOD";
+
   @Override
   protected JButton getButton(@NotNull final StudyEditor selectedStudyEditor) {
     return selectedStudyEditor.getNextTaskButton();
index fcf9ef40c7d48d944bba5a7784470f156001a14a..16036a7ba91b758e1a422f95f2f22d3db3531066 100644 (file)
@@ -12,7 +12,7 @@ import java.util.List;
  */
 public class StudyNextWindowAction extends StudyWindowNavigationAction {
   public static final String ACTION_ID = "NextWindow";
-  public static final String SHORTCUT = "ctrl pressed PERIOD";
+  public static final String SHORTCUT = "ctrl shift pressed PERIOD";
   public static final String SHORTCUT2 = "ctrl pressed ENTER";
 
   public StudyNextWindowAction() {
index 347456189a005a92b3880bc3e5fe6cc85d71f5b9..1e602bd059ffd50902bf369dc7991f9352d2f9ff 100644 (file)
@@ -14,7 +14,7 @@ import java.util.List;
  */
 public class StudyPrevWindowAction extends StudyWindowNavigationAction {
   public static final String ACTION_ID = "PrevWindowAction";
-  public static final String SHORTCUT = "ctrl pressed COMMA";
+  public static final String SHORTCUT = "ctrl shift pressed COMMA";
 
   public StudyPrevWindowAction() {
     super("PrevWindowAction", "Select previous window", StudyIcons.Prev);
index f6da6a0678943f2f279716c7c7daf48a4e19eecd..02cc363558344ebf9208bf9dbdad1a3668a1fdfb 100644 (file)
@@ -9,6 +9,8 @@ import javax.swing.*;
 
 public class StudyPreviousStudyTaskAction extends StudyTaskNavigationAction {
 
+  public static final String ACTION_ID = "PreviousTaskAction";
+  public static final String SHORTCUT = "ctrl pressed COMMA";
   @Override
   protected JButton getButton(@NotNull final StudyEditor selectedStudyEditor) {
     return selectedStudyEditor.getPrevTaskButton();
index b1ff29b58270d14fb9a387d1bd83e001fc390d04..1a15afdf70132a4ba964ae823370718c6f599d84 100644 (file)
@@ -28,6 +28,8 @@ import java.io.*;
 
 public class StudyRefreshTaskFileAction extends DumbAwareAction {
   private static final Logger LOG = Logger.getInstance(StudyRefreshTaskFileAction.class.getName());
+  public static final String ACTION_ID = "RefreshTaskAction";
+  public static final String SHORTCUT = "ctrl shift pressed X";
 
   public static void refresh(final Project project) {
     ApplicationManager.getApplication().invokeLater(new Runnable() {
index a85df6c4cf14cfd30ead2de9267147993bfec38d..ec661f8f0b8879d50e590bc34bf88a0e79fb7b5e 100644 (file)
@@ -66,7 +66,6 @@ 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;
@@ -193,11 +192,11 @@ public class StudyEditor implements TextEditor {
   }
 
   private void initializeButtons(@NotNull final JPanel taskActionsPanel, @NotNull final TaskFile taskFile) {
-    myCheckButton = addButton(taskActionsPanel, "Check task", StudyIcons.Resolve);
-    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);
+    myCheckButton = addButton(taskActionsPanel, "Check task (Ctrl + Alt + Enter)", StudyIcons.Resolve);
+    myPrevTaskButton = addButton(taskActionsPanel, "Previous task (Ctrl + &lt;)", StudyIcons.Prev);
+    myNextTaskButton = addButton(taskActionsPanel, "Next task (Ctrl + >)", AllIcons.Actions.Forward);
+    myRefreshButton = addButton(taskActionsPanel, "Reset task file (Ctrl + Shift + X)", AllIcons.Actions.Refresh);
+    JButton myShowHintButton = addButton(taskActionsPanel, "Show hint for task window (Ctrl + 7)", StudyIcons.ShowHint);
     if (!taskFile.getTask().getUserTests().isEmpty()) {
       JButton runButton = addButton(taskActionsPanel, "Run", AllIcons.General.Run);
       runButton.addActionListener(new ActionListener() {