Minor Rename text area field
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 25 Jul 2016 16:17:11 +0000 (19:17 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 25 Jul 2016 16:25:34 +0000 (19:25 +0300)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.form
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java

index 2bdb9ce10a8b2116c2ec22705cc9135bf316aa03..738a4ed1379b839633550f51989cf5ede0c394dc 100644 (file)
@@ -53,7 +53,7 @@
         <properties/>
         <border type="none"/>
         <children>
-          <component id="d0efc" class="javax.swing.JTextArea" binding="myHintTextField">
+          <component id="d0efc" class="javax.swing.JTextArea" binding="myHintTextArea">
             <constraints>
               <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
                 <preferred-size width="300" height="150"/>
index e1f6fc0a08ad9dc56c0c7f64914ab6ff85e25f0a..c33ab81687e1ec2f43bcdcaa4607f9336043f2c3 100644 (file)
@@ -21,7 +21,7 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
   private static String ourFirstHintText = "Type here to add hint";
   
   private JPanel myPanel;
-  private JTextArea myHintTextField;
+  private JTextArea myHintTextArea;
   private JBLabel myHintLabel;
   private JPanel actionsPanel;
   private JPanel myHintsPanel;
@@ -36,21 +36,21 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
     super(new BorderLayout());
     add(myPanel, BorderLayout.CENTER);
 
-    myHintTextField.setLineWrap(true);
-    myHintTextField.setWrapStyleWord(true);
+    myHintTextArea.setLineWrap(true);
+    myHintTextArea.setWrapStyleWord(true);
     myPlaceholderTextArea.setBorder(BorderFactory.createLineBorder(JBColor.border()));
     myHintsPanel.setBorder(BorderFactory.createLineBorder(JBColor.border()));
-    myHintTextField.setFont(myPlaceholderTextArea.getFont());
+    myHintTextArea.setFont(myPlaceholderTextArea.getFont());
     if (myHints.get(myShownHintNumber).equals(ourFirstHintText)) {
-      myHintTextField.setForeground(UIUtil.getInactiveTextColor());
+      myHintTextArea.setForeground(UIUtil.getInactiveTextColor());
     }
-    myHintTextField.setText(myHints.get(myShownHintNumber));
-    myHintTextField.addFocusListener(new FocusAdapter() {
+    myHintTextArea.setText(myHints.get(myShownHintNumber));
+    myHintTextArea.addFocusListener(new FocusAdapter() {
       @Override
       public void focusGained(FocusEvent e) {
-        if (myHintTextField.getText().equals(ourFirstHintText)) {
-          myHintTextField.setForeground(UIUtil.getActiveTextColor());
-          myHintTextField.setText("");
+        if (myHintTextArea.getText().equals(ourFirstHintText)) {
+          myHintTextArea.setForeground(UIUtil.getActiveTextColor());
+          myHintTextArea.setText("");
         }
       }
     });
@@ -80,8 +80,8 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
   }
 
   public void setHintText(String hintTextField) {
-    myHintTextField.setForeground(UIUtil.getActiveTextColor());
-    myHintTextField.setText(hintTextField);
+    myHintTextArea.setForeground(UIUtil.getActiveTextColor());
+    myHintTextArea.setText(hintTextField);
   }
 
   public String getAnswerPlaceholderText() {
@@ -89,7 +89,7 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
   }
 
   public List<String> getHints() {
-    final String hintText = myHintTextField.getText();
+    final String hintText = myHintTextArea.getText();
     if (myShownHintNumber == 0 && hintText.equals(ourFirstHintText)) {
       myHints.set(myShownHintNumber, "");
     }
@@ -117,7 +117,7 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
 
     @Override
     public void actionPerformed(AnActionEvent e) {
-      myHints.set(myShownHintNumber, myHintTextField.getText());
+      myHints.set(myShownHintNumber, myHintTextArea.getText());
       setHintText(myHints.get(++myShownHintNumber));
       updateHintNumberLabel();
     }
@@ -136,7 +136,7 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
 
     @Override
     public void actionPerformed(AnActionEvent e) {
-      myHints.set(myShownHintNumber, myHintTextField.getText());
+      myHints.set(myShownHintNumber, myHintTextArea.getText());
       setHintText(myHints.get(--myShownHintNumber));
       updateHintNumberLabel();
     }