exceptions with the default project
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 26 Jan 2012 11:17:41 +0000 (15:17 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 26 Jan 2012 11:24:22 +0000 (15:24 +0400)
java/execution/openapi/src/com/intellij/execution/JavaExecutionUtil.java
java/openapi/src/com/intellij/ui/classFilter/ClassFilterEditor.java
platform/lang-impl/src/com/intellij/codeInsight/AutoPopupController.java
platform/platform-impl/src/com/intellij/ide/actions/UndoRedoAction.java
plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java

index 3239824d4adad7db81e806da4fc960de90098701..5097256ac559ee984b722000bb0d8f5eec76aaa4 100644 (file)
@@ -140,6 +140,7 @@ public class JavaExecutionUtil {
 
   @Nullable
   public static PsiClass findMainClass(final Project project, final String mainClassName, final GlobalSearchScope scope) {
+    if (project.isDefault()) return null;
     final PsiManager psiManager = PsiManager.getInstance(project);
     final String shortName = StringUtil.getShortName(mainClassName);
     final String packageName = StringUtil.getPackageName(mainClassName);
index 4ad2f7edc851a1777c2434ff9425f776f78b4e34..517f2a226ff41cc0372885cb43d02b8e48111d78 100644 (file)
@@ -131,11 +131,13 @@ public class ClassFilterEditor extends JPanel implements ComponentWithEmptyText
       }
     });
 
+    myAddPatternButton.setEnabled(!myProject.isDefault());
     myAddPatternButton.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
         addPatternFilter();
       }
     });
+    myAddClassButton.setEnabled(!myProject.isDefault());
     myAddClassButton.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
         addClassFilter();
index ee1818ffa8454b1caf783bf7f0a55e8bad70e570..179f975b6ee9dfd21386c8a506ab7cbd773fb537 100644 (file)
@@ -112,6 +112,7 @@ public class AutoPopupController implements Disposable {
     Runnable request = new Runnable() {
       @Override
       public void run() {
+        if (myProject.isDefault()) return;
         CompletionAutoPopupHandler.runLaterWithCommitted(myProject, editor.getDocument(), new Runnable() {
           @Override
           public void run() {
index fde61b0ec3709b59ccff672ebc95a0b80f45eab7..0fc43b2ee49adf3299aae61aab994cc2419ce331 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.ide.actions;
 
-import com.intellij.idea.ActionsBundle;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
@@ -26,8 +25,6 @@ import com.intellij.openapi.fileEditor.TextEditor;
 import com.intellij.openapi.project.DumbAwareAction;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.text.StringUtil;
-import org.jetbrains.annotations.Nullable;
 
 public abstract class UndoRedoAction extends DumbAwareAction {
   public UndoRedoAction() {
@@ -56,7 +53,7 @@ public abstract class UndoRedoAction extends DumbAwareAction {
     }
 
     UndoManager undoManager = getUndoManager(editor, dataContext);
-    presentation.setEnabled(isAvailable(editor, undoManager));
+    presentation.setEnabled(undoManager != null && isAvailable(editor, undoManager));
 
     Pair<String, String> pair = getActionNameAndDescription(editor, undoManager);
 
index fb8c5ef9b5e284b5039e6e7c21cc88e2b0c57143..e1a709993f9763212a2fc2ee287b8d45510cbe59 100644 (file)
@@ -210,6 +210,7 @@ public class TestNGConfigurationEditor extends SettingsEditor<TestNGConfiguratio
     }
     model.setType(TestType.CLASS);
     addListener.addActionListener(new AddTestListenerListener());
+    addListener.setEnabled(!project.isDefault());
     removeListener.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent event) {