Add ability to provide listener to error text label on project creation panel
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Fri, 17 Jun 2016 12:26:53 +0000 (15:26 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Fri, 17 Jun 2016 12:56:42 +0000 (15:56 +0300)
python/ide/src/com/jetbrains/python/newProject/actions/ProjectSpecificSettingsStep.java
python/openapi/src/com/jetbrains/python/newProject/PythonProjectGenerator.java

index 22da09e142f126853c8494b68ea0a0a4908f249c..ab66ad45a7a353314c2ce602c6d6dd9dae3ec858 100644 (file)
@@ -25,7 +25,6 @@ import com.intellij.openapi.project.ProjectManager;
 import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.ui.LabeledComponent;
 import com.intellij.openapi.ui.VerticalFlowLayout;
-import com.intellij.openapi.util.Condition;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.platform.DirectoryProjectGenerator;
 import com.intellij.ui.DocumentAdapter;
@@ -254,6 +253,8 @@ public class ProjectSpecificSettingsStep extends ProjectSettingsStepBase impleme
           checkValid();
         }
       });
+      
+      myErrorLabel.addMouseListener(((PythonProjectGenerator)myProjectGenerator).getErrorLabelMouseListener());
     }
     myLocationField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
       @Override
index a56503df72accfeeb9ad13891f23f0d08580a6c3..945149868e473707dd208d74be40891d984a75f5 100644 (file)
@@ -24,11 +24,13 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
+import java.awt.event.MouseListener;
 import java.io.File;
 import java.util.List;
 
 public abstract class PythonProjectGenerator {
   private final List<SettingsListener> myListeners = ContainerUtil.newArrayList();
+  @Nullable private MouseListener myErrorLabelMouseListener;
 
   @Nullable
   public JComponent getSettingsPanel(File baseDir) throws ProcessCanceledException {
@@ -68,4 +70,13 @@ public abstract class PythonProjectGenerator {
   public BooleanFunction<PythonProjectGenerator> beforeProjectGenerated(@NotNull final Sdk sdk) {
     return null;
   }
+
+  public void addErrorLabelMouseListener(@NotNull final MouseListener mouseListener) {
+    myErrorLabelMouseListener = mouseListener;
+  }
+
+  @Nullable
+  public MouseListener getErrorLabelMouseListener() {
+    return myErrorLabelMouseListener;
+  }
 }