From 35f18c1871ab0ffc2edcdbe18ac11db4af3ebd79 Mon Sep 17 00:00:00 2001 From: "liana.bakradze" Date: Mon, 25 Apr 2016 18:40:55 +0200 Subject: [PATCH] EDU-596 Remove show hint checkbox in Add/Edit Answer Placeholder dialog --- .../ui/CCCreateAnswerPlaceholderDialog.java | 1 - .../ui/CCCreateAnswerPlaceholderPanel.form | 20 ++++++------- .../ui/CCCreateAnswerPlaceholderPanel.java | 28 ------------------- 3 files changed, 9 insertions(+), 40 deletions(-) diff --git a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderDialog.java b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderDialog.java index 5f984acf1d95..5afc27cae206 100644 --- a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderDialog.java +++ b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderDialog.java @@ -43,7 +43,6 @@ public class CCCreateAnswerPlaceholderDialog extends DialogWrapper { private void setHintText(AnswerPlaceholder answerPlaceholder) { String hintText = answerPlaceholder.getHint(); - myPanel.doClick(); myPanel.setHintText(hintText); } diff --git a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.form b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.form index a2fadacedcd5..5e4b17d84c04 100644 --- a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.form +++ b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.form @@ -13,7 +13,7 @@ - + @@ -41,16 +41,6 @@ - - - - - - - - - - @@ -71,6 +61,14 @@ + + + + + + + + diff --git a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java index cc55b58ec101..28cd014d3288 100644 --- a/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java +++ b/python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/ui/CCCreateAnswerPlaceholderPanel.java @@ -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; } -- 2.23.3