EDU-596 Remove show hint checkbox in Add/Edit Answer Placeholder dialog
authorliana.bakradze <liana.bakradze@jetbrains.com>
Mon, 25 Apr 2016 16:40:55 +0000 (18:40 +0200)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Mon, 25 Apr 2016 16:43:25 +0000 (18:43 +0200)
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderDialog.java
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 5f984acf1d95b40fc0308e99912dcf95a62cdf39..5afc27cae206cd2f933e38e7fa6655538418e2d0 100644 (file)
@@ -43,7 +43,6 @@ public class CCCreateAnswerPlaceholderDialog extends DialogWrapper {
   private void setHintText(AnswerPlaceholder answerPlaceholder) {
     String hintText = answerPlaceholder.getHint();
 
-    myPanel.doClick();
     myPanel.setHintText(hintText);
   }
 
index a2fadacedcd52546962330af5291830ac8e49719..5e4b17d84c040aa077337035853c90f486296e37 100644 (file)
@@ -13,7 +13,7 @@
           <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
-          <text value="Placeholder text:"/>
+          <text value="Placeholder:"/>
         </properties>
       </component>
       <grid id="cbc70" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
           </component>
         </children>
       </grid>
-      <component id="f86b4" class="javax.swing.JCheckBox" binding="myCreateHintCheckBox" default-binding="true">
-        <constraints>
-          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
-        </constraints>
-        <properties>
-          <margin top="2" left="0" bottom="2" right="2"/>
-          <text value="Create hint"/>
-          <verticalAlignment value="0"/>
-        </properties>
-      </component>
       <grid id="51a63" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
         <margin top="0" left="0" bottom="0" right="0"/>
         <constraints>
           </component>
         </children>
       </grid>
+      <component id="61da7" class="javax.swing.JLabel">
+        <constraints>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties>
+          <text value="Hint:"/>
+        </properties>
+      </component>
     </children>
   </grid>
 </form>
index cc55b58ec101e02617d99e0d12dd9831bc583d2b..28cd014d328864f7ff4b6507dc942e37ef3ccbda 100644 (file)
@@ -2,41 +2,21 @@ package com.jetbrains.edu.coursecreator.ui;
 
 import javax.swing.*;
 import java.awt.*;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 public class CCCreateAnswerPlaceholderPanel extends JPanel {
 
   private JPanel myPanel;
   private JTextArea myHintText;
-  private JCheckBox myCreateHintCheckBox;
   private JTextField myAnswerPlaceholderText;
 
   public CCCreateAnswerPlaceholderPanel() {
     super(new BorderLayout());
     add(myPanel, BorderLayout.CENTER);
-    enableHint(false);
     myHintText.setLineWrap(true);
     myHintText.setWrapStyleWord(true);
-    myCreateHintCheckBox.addItemListener(new ItemListener() {
-      @Override
-      public void itemStateChanged(ItemEvent e) {
-        int state = e.getStateChange();
-        // 1 for checked
-        enableHint(state == 1);
-        if (state == 2) {
-          resetHint();
-        }
-      }
-    });
-
     myAnswerPlaceholderText.grabFocus();
   }
 
-  private void enableHint(boolean isEnable) {
-    myHintText.setEnabled(isEnable);
-  }
-
   public void setAnswerPlaceholderText(String answerPlaceholderText) {
     myAnswerPlaceholderText.setText(answerPlaceholderText);
   }
@@ -53,14 +33,6 @@ public class CCCreateAnswerPlaceholderPanel extends JPanel {
     return myHintText.getText();
   }
 
-  public void doClick() {
-    myCreateHintCheckBox.doClick();
-  }
-
-  public void resetHint() {
-    myHintText.setText("");
-  }
-
   public JComponent getPreferredFocusedComponent() {
     return myAnswerPlaceholderText;
   }