java debugger cleanup
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Tue, 24 Feb 2015 17:59:50 +0000 (20:59 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Tue, 24 Feb 2015 18:04:53 +0000 (21:04 +0300)
java/debugger/impl/src/com/intellij/debugger/actions/AddToWatchActionHandler.java
java/debugger/impl/src/com/intellij/debugger/actions/EvaluateActionHandler.java [deleted file]
java/debugger/impl/src/com/intellij/debugger/actions/ShowFrameAction.java [deleted file]
java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java
java/debugger/impl/src/com/intellij/debugger/ui/DebuggerPanelsManager.java
java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java [deleted file]
java/debugger/impl/src/com/intellij/debugger/ui/StatementEvaluationDialog.java [deleted file]
resources/src/idea/JavaActions.xml

index a93bf8101a310d9a8c00ffc24cce18aa2565b638..c25db1da19b5f39572f36e164b552d18f1e1ecc0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ public class AddToWatchActionHandler extends DebuggerActionHandler {
     if(session == null) {
       return;
     }
-    final MainWatchPanel watchPanel = DebuggerPanelsManager.getInstance(debuggerContext.getProject()).getWatchPanel();
+    final MainWatchPanel watchPanel = null;// DebuggerPanelsManager.getInstance(debuggerContext.getProject()).getWatchPanel();
 
     if(watchPanel == null) {
       return;
diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/EvaluateActionHandler.java b/java/debugger/impl/src/com/intellij/debugger/actions/EvaluateActionHandler.java
deleted file mode 100644 (file)
index 22694cb..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Copyright 2000-2009 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Class EvaluateAction
- * @author Jeka
- */
-package com.intellij.debugger.actions;
-
-import com.intellij.debugger.DebuggerInvocationUtil;
-import com.intellij.debugger.engine.evaluation.CodeFragmentKind;
-import com.intellij.debugger.engine.evaluation.EvaluateException;
-import com.intellij.debugger.engine.evaluation.TextWithImports;
-import com.intellij.debugger.engine.evaluation.TextWithImportsImpl;
-import com.intellij.debugger.engine.events.DebuggerContextCommandImpl;
-import com.intellij.debugger.impl.DebuggerContextImpl;
-import com.intellij.debugger.impl.DebuggerSession;
-import com.intellij.debugger.impl.DebuggerUtilsEx;
-import com.intellij.debugger.settings.DebuggerSettings;
-import com.intellij.debugger.ui.ExpressionEvaluationDialog;
-import com.intellij.debugger.ui.StatementEvaluationDialog;
-import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeExpression;
-import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
-import com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl;
-import com.intellij.debugger.ui.impl.watch.WatchItemDescriptor;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.actionSystem.DataKeys;
-import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.DialogWrapper;
-import com.intellij.openapi.ui.Messages;
-import com.intellij.xdebugger.impl.actions.DebuggerActionHandler;
-import org.jetbrains.annotations.NotNull;
-
-public class EvaluateActionHandler extends DebuggerActionHandler {
-  public boolean isEnabled(@NotNull final Project project, final AnActionEvent event) {
-    DebuggerContextImpl context = DebuggerAction.getDebuggerContext(event.getDataContext());
-
-    if(context != null) {
-      DebuggerSession debuggerSession = context.getDebuggerSession();
-      return debuggerSession != null && debuggerSession.isPaused();
-    }
-
-    return false;
-  }
-
-  public void perform(@NotNull final Project project, final AnActionEvent event) {
-    final DataContext dataContext = event.getDataContext();
-    final DebuggerContextImpl context = DebuggerAction.getDebuggerContext(dataContext);
-
-    if(context == null) {
-      return;
-    }
-
-    final Editor editor = event.getData(DataKeys.EDITOR);
-
-    TextWithImports editorText = DebuggerUtilsEx.getEditorText(editor);
-    if (editorText == null) {
-      final DebuggerTreeNodeImpl selectedNode = DebuggerAction.getSelectedNode(dataContext);
-      final String actionName = event.getPresentation().getText();
-
-      if (selectedNode != null && selectedNode.getDescriptor() instanceof ValueDescriptorImpl) {
-        context.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(context) {
-          public void threadAction() {
-            try {
-              final TextWithImports evaluationText = DebuggerTreeNodeExpression.createEvaluationText(selectedNode, context);
-              DebuggerInvocationUtil.swingInvokeLater(project, new Runnable() {
-                public void run() {
-                  showEvaluationDialog(project, evaluationText);
-                }
-              });
-            }
-            catch (final EvaluateException e1) {
-              DebuggerInvocationUtil.swingInvokeLater(project, new Runnable() {
-                public void run() {
-                  Messages.showErrorDialog(project, e1.getMessage(), actionName);
-                }
-              });
-            }
-          }
-
-          protected void commandCancelled() {
-            DebuggerInvocationUtil.swingInvokeLater(project, new Runnable() {
-              public void run() {
-                if(selectedNode.getDescriptor() instanceof WatchItemDescriptor) {
-                  try {
-                    TextWithImports editorText = DebuggerTreeNodeExpression.createEvaluationText(selectedNode, context);
-                    showEvaluationDialog(project, editorText);
-                  }
-                  catch (EvaluateException e1) {
-                    Messages.showErrorDialog(project, e1.getMessage(), actionName);
-                  }
-                }
-              }
-            });
-          }
-        });
-        return;
-      }
-    }
-
-    showEvaluationDialog(project, editorText);
-  }
-
-  public static void showEvaluationDialog(Project project, TextWithImports defaultExpression, String dialogType) {
-    if(defaultExpression == null) {
-      defaultExpression = new TextWithImportsImpl(CodeFragmentKind.EXPRESSION, "");
-    }
-
-    CodeFragmentKind kind = DebuggerSettings.EVALUATE_FRAGMENT.equals(dialogType) ? CodeFragmentKind.CODE_BLOCK : CodeFragmentKind.EXPRESSION;
-
-    DebuggerSettings.getInstance().EVALUATION_DIALOG_TYPE = dialogType;
-    TextWithImportsImpl text = new TextWithImportsImpl(kind, defaultExpression.getText(), defaultExpression.getImports(), defaultExpression.getFileType());
-
-    final DialogWrapper dialog;
-    if(DebuggerSettings.EVALUATE_FRAGMENT.equals(dialogType)) {
-      dialog = new StatementEvaluationDialog(project, text);
-    }
-    else {
-      dialog = new ExpressionEvaluationDialog(project, text);
-    }
-
-    dialog.show();
-  }
-
-  public static void showEvaluationDialog(Project project, TextWithImports text) {
-    showEvaluationDialog(project, text, DebuggerSettings.getInstance().EVALUATION_DIALOG_TYPE);
-  }
-}
diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ShowFrameAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ShowFrameAction.java
deleted file mode 100644 (file)
index 6b1bf1f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2000-2009 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.intellij.debugger.actions;
-
-import com.intellij.debugger.impl.DebuggerContextImpl;
-import com.intellij.debugger.impl.DebuggerStateManager;
-import com.intellij.debugger.impl.DebuggerContextImpl;
-import com.intellij.debugger.impl.DebuggerSession;
-import com.intellij.debugger.ui.DebuggerPanelsManager;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
-import com.intellij.openapi.project.Project;
-
-/**
- * User: lex
- * Date: Sep 26, 2003
- * Time: 7:45:21 PM
- */
-public class ShowFrameAction extends GotoFrameSourceAction {
-  public void actionPerformed(AnActionEvent e) {
-    super.actionPerformed(e);
-    DebuggerStateManager stateManager = getContextManager(e.getDataContext());
-    DebuggerContextImpl context = stateManager.getContext();
-
-    if(context != null) {
-      DebuggerPanelsManager.getInstance(context.getProject()).showFramePanel();
-    }
-  }
-}
index ce2215f1665b18475b6b1bf23889b09e9b435977..92fbca93472078543827867ec99214dea7683c07 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@ import com.intellij.debugger.jdi.ThreadReferenceProxyImpl;
 import com.intellij.debugger.jdi.VirtualMachineProxyImpl;
 import com.intellij.debugger.requests.Requestor;
 import com.intellij.debugger.settings.DebuggerSettings;
-import com.intellij.debugger.ui.DebuggerPanelsManager;
 import com.intellij.debugger.ui.breakpoints.Breakpoint;
 import com.intellij.debugger.ui.breakpoints.LineBreakpoint;
 import com.intellij.execution.configurations.RemoteConnection;
@@ -452,7 +451,6 @@ public class DebugProcessEvents extends DebugProcessImpl {
           DebuggerInvocationUtil.invokeAndWait(getProject(), new Runnable() {
             @Override
             public void run() {
-              DebuggerPanelsManager.getInstance(getProject()).toFront(mySession);
               final String displayName = requestor instanceof Breakpoint? ((Breakpoint)requestor).getDisplayName() : requestor.getClass().getSimpleName();
               final String message = DebuggerBundle.message("error.evaluating.breakpoint.condition.or.action", displayName, ex.getMessage());
               considerRequestHit[0] = Messages.showYesNoDialog(getProject(), message, ex.getTitle(), Messages.getQuestionIcon()) == Messages.YES;
index 3c346146ef60056a3ecf7377181c566accc26462..71811a2bde26b95ed033d2e1bb6f8d56a731736f 100644 (file)
@@ -24,10 +24,8 @@ import com.intellij.debugger.engine.JavaDebugProcess;
 import com.intellij.debugger.impl.DebuggerContextImpl;
 import com.intellij.debugger.impl.DebuggerSession;
 import com.intellij.debugger.impl.DebuggerStateManager;
-import com.intellij.debugger.ui.impl.MainWatchPanel;
 import com.intellij.debugger.ui.tree.render.BatchEvaluator;
 import com.intellij.execution.ExecutionException;
-import com.intellij.execution.ExecutionManager;
 import com.intellij.execution.Executor;
 import com.intellij.execution.configurations.RemoteConnection;
 import com.intellij.execution.configurations.RunProfileState;
@@ -39,8 +37,6 @@ import com.intellij.execution.ui.RunContentDescriptor;
 import com.intellij.execution.ui.RunContentManager;
 import com.intellij.execution.ui.RunContentWithExecutorListener;
 import com.intellij.openapi.components.ProjectComponent;
-import com.intellij.openapi.diagnostic.Logger;
-import com.intellij.openapi.editor.colors.EditorColorsManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.xdebugger.XDebugProcess;
@@ -51,43 +47,10 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 public class DebuggerPanelsManager implements ProjectComponent {
-  private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.DebuggerPanelsManager");
-
   private final Project myProject;
-  private final ExecutionManager myExecutionManager;
-
-  //private final PositionHighlighter myEditorManager;
-  //private final HashMap<ProcessHandler, DebuggerSessionTab> mySessionTabs = new HashMap<ProcessHandler, DebuggerSessionTab>();
 
-  public DebuggerPanelsManager(Project project, final EditorColorsManager colorsManager, ExecutionManager executionManager) {
+  public DebuggerPanelsManager(Project project) {
     myProject = project;
-    myExecutionManager = executionManager;
-
-    //myEditorManager = new PositionHighlighter(myProject, getContextManager());
-    //
-    //final EditorColorsListener myColorsListener = new EditorColorsListener() {
-    //  public void globalSchemeChange(EditorColorsScheme scheme) {
-    //    myEditorManager.updateContextPointDescription();
-    //  }
-    //};
-    //colorsManager.addEditorColorsListener(myColorsListener);
-    //Disposer.register(project, new Disposable() {
-    //  public void dispose() {
-    //    colorsManager.removeEditorColorsListener(myColorsListener);
-    //  }
-    //});
-    //
-    //getContextManager().addListener(new DebuggerContextListener() {
-    //  public void changeEvent(final DebuggerContextImpl newContext, int event) {
-    //    if (event == DebuggerSession.EVENT_PAUSE) {
-    //      DebuggerInvocationUtil.invokeLater(myProject, new Runnable() {
-    //        public void run() {
-    //          toFront(newContext.getDebuggerSession());
-    //        }
-    //      });
-    //    }
-    //  }
-    //});
   }
 
   private DebuggerStateManager getContextManager() {
@@ -196,32 +159,6 @@ public class DebuggerPanelsManager implements ProjectComponent {
     return project.getComponent(DebuggerPanelsManager.class);
   }
 
-  @Nullable
-  public MainWatchPanel getWatchPanel() {
-    DebuggerSessionTab sessionTab = getSessionTab();
-    return sessionTab != null ? sessionTab.getWatchPanel() : null;
-  }
-
-  @Nullable
-  public DebuggerSessionTab getSessionTab() {
-    DebuggerContextImpl context = DebuggerManagerEx.getInstanceEx(myProject).getContext();
-    return getSessionTab(context.getDebuggerSession());
-  }
-
-  public void showFramePanel() {
-    DebuggerSessionTab sessionTab = getSessionTab();
-    if (sessionTab != null) {
-      sessionTab.showFramePanel();
-    }
-  }
-
-  public void toFront(DebuggerSession session) {
-    DebuggerSessionTab sessionTab = getSessionTab(session);
-    if (sessionTab != null) {
-      sessionTab.toFront(true, null);
-    }
-  }
-
   private static DebuggerSession getSession(Project project, RunContentDescriptor descriptor) {
     for (JavaDebugProcess process : XDebuggerManager.getInstance(project).getDebugProcesses(JavaDebugProcess.class)) {
       if (Comparing.equal(process.getProcessHandler(), descriptor.getProcessHandler())) {
@@ -230,11 +167,4 @@ public class DebuggerPanelsManager implements ProjectComponent {
     }
     return null;
   }
-
-  @Nullable
-  private DebuggerSessionTab getSessionTab(DebuggerSession session) {
-    //return session != null ? getSessionTab(session.getProcess().getExecutionResult().getProcessHandler()) : null;
-    return null;
-  }
-
 }
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java
deleted file mode 100644 (file)
index a4e1b16..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2000-2009 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.intellij.debugger.ui;
-
-import com.intellij.debugger.DebuggerBundle;
-import com.intellij.debugger.DebuggerInvocationUtil;
-import com.intellij.debugger.HelpID;
-import com.intellij.debugger.actions.EvaluateActionHandler;
-import com.intellij.debugger.engine.evaluation.CodeFragmentFactory;
-import com.intellij.debugger.engine.evaluation.TextWithImports;
-import com.intellij.debugger.impl.PositionUtil;
-import com.intellij.debugger.settings.DebuggerSettings;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.CustomShortcutSet;
-import com.intellij.openapi.help.HelpManager;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.wm.ex.AbstractDelegatingToRootTraversalPolicy;
-import com.intellij.ui.IdeBorderFactory;
-import com.intellij.ui.components.JBLabel;
-import com.intellij.util.ui.UIUtil;
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.InputEvent;
-import java.awt.event.KeyEvent;
-
-public class ExpressionEvaluationDialog extends EvaluationDialog {
-
-  public ExpressionEvaluationDialog(Project project, TextWithImports defaultExpression) {
-    super(project, defaultExpression);
-    setTitle(DebuggerBundle.message("evaluate.expression.dialog.title"));
-
-    final KeyStroke expressionStroke = KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_MASK);
-    final KeyStroke resultStroke = KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_MASK);
-
-    final JRootPane rootPane = getRootPane();
-
-    final AnAction anAction = new AnAction() {
-      public void actionPerformed(AnActionEvent e) {
-        getExpressionCombo().requestFocus();
-      }
-    };
-    anAction.registerCustomShortcutSet(new CustomShortcutSet(expressionStroke), rootPane);
-    addDisposeRunnable(new Runnable() {
-      public void run() {
-        anAction.unregisterCustomShortcutSet(rootPane);
-      }
-    });
-
-    final AnAction anAction2 = new AnAction() {
-      public void actionPerformed(AnActionEvent e) {
-        getEvaluationPanel().getWatchTree().requestFocus();
-      }
-    };
-    anAction2.registerCustomShortcutSet(new CustomShortcutSet(resultStroke), rootPane);
-    addDisposeRunnable(new Runnable() {
-      public void run() {
-        anAction2.unregisterCustomShortcutSet(rootPane);
-      }
-    });
-
-    init();
-  }
-
-  protected DebuggerExpressionComboBox createEditor(final CodeFragmentFactory factory) {
-    return new DebuggerExpressionComboBox(getProject(), PositionUtil.getContextElement(getDebuggerContext()), "evaluation", factory);
-  }
-
-  protected JComponent createCenterPanel() {
-    final JPanel panel = new JPanel(new BorderLayout());
-
-    final JPanel exprPanel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, 0));
-    exprPanel.add(new JLabel(DebuggerBundle.message("label.evaluate.dialog.expression")), BorderLayout.WEST);
-    exprPanel.add(getExpressionCombo(), BorderLayout.CENTER);
-    final JBLabel help = new JBLabel("Press Enter to Evaluate or Control+Enter to evaluate and add to the Watches", SwingConstants.RIGHT);
-    help.setBorder(IdeBorderFactory.createEmptyBorder(2,0,6,0));
-    help.setComponentStyle(UIUtil.ComponentStyle.SMALL);
-    help.setFontColor(UIUtil.FontColor.BRIGHTER);
-    exprPanel.add(help, BorderLayout.SOUTH);
-
-
-    final JPanel resultPanel = new JPanel(new BorderLayout());
-    //resultPanel.add(new JLabel(DebuggerBundle.message("label.evaluate.dialog.result")), BorderLayout.NORTH);
-    resultPanel.add(getEvaluationPanel(), BorderLayout.CENTER);
-
-    panel.add(exprPanel, BorderLayout.NORTH);
-    panel.add(resultPanel, BorderLayout.CENTER);
-    
-    panel.setFocusTraversalPolicyProvider(true);
-    panel.setFocusTraversalPolicy(new AbstractDelegatingToRootTraversalPolicy() {
-      @Override
-      public Component getComponentBefore(Container aContainer, Component aComponent) {
-        boolean focusExpressionCombo = isParent(aComponent, getEvaluationPanel());
-        return focusExpressionCombo ? getExpressionCombo().getEditorComponent() : super.getComponentBefore(aContainer, aComponent);
-      }
-
-      @Override
-      public Component getComponentAfter(Container aContainer, Component aComponent) {
-        boolean focusEvaluationPanel = isParent(aComponent, exprPanel);
-        return focusEvaluationPanel ? getEvaluationPanel().getTree() : super.getComponentAfter(aContainer, aComponent);
-      }
-
-      private boolean isParent(@NotNull Component component, @NotNull Container parent) {
-        for (Component c = component; c != null; c = c.getParent()) {
-          if (c == parent) {
-            return true;
-          }
-        }
-        return false;
-      }
-    });
-
-    return panel;
-  }
-
-  protected void initDialogData(TextWithImports text) {
-    super.initDialogData(text);
-    getExpressionCombo().selectAll();
-  }
-
-  private DebuggerExpressionComboBox getExpressionCombo() {
-    return (DebuggerExpressionComboBox)getEditor();
-  }
-
-  @NotNull
-  protected Action[] createActions() {
-    return new Action[] { getOKAction(), getCancelAction(), new SwitchAction(), getHelpAction() } ;
-  }
-
-  @Override
-  protected void createDefaultActions() {
-    super.createDefaultActions();
-    myOKAction = new OkAction(){
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        super.actionPerformed(e);
-        if ((e.getModifiers() & InputEvent.CTRL_MASK) != 0) {
-          addCurrentExpressionToWatches();
-        }
-      }
-    };
-  }
-
-  private void addCurrentExpressionToWatches() {
-    final DebuggerSessionTab tab = DebuggerPanelsManager.getInstance(getProject()).getSessionTab();
-    if (tab != null) {
-      final TextWithImports evaluate = getCodeToEvaluate();
-      if (evaluate != null) {
-        tab.getWatchPanel().getWatchTree().addWatch(evaluate, null);
-      }
-    }
-  }
-
-  protected void doHelpAction() {
-    HelpManager.getInstance().invokeHelp(HelpID.EVALUATE);
-  }
-
-  private class SwitchAction extends AbstractAction {
-    public SwitchAction() {
-      putValue(Action.NAME, DebuggerBundle.message("action.evaluate.expression.dialog.switch.mode.description"));
-    }
-
-    public void actionPerformed(ActionEvent e) {
-      final TextWithImports text = getEditor().getText();
-      doCancelAction();
-      DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
-        public void run() {
-          EvaluateActionHandler.showEvaluationDialog(getProject(), text, DebuggerSettings.EVALUATE_FRAGMENT);
-        }
-      });
-    }
-  }
-
-}
diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/StatementEvaluationDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/StatementEvaluationDialog.java
deleted file mode 100644 (file)
index 653f24f..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright 2000-2009 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.intellij.debugger.ui;
-
-import com.intellij.debugger.DebuggerBundle;
-import com.intellij.debugger.DebuggerInvocationUtil;
-import com.intellij.debugger.HelpID;
-import com.intellij.debugger.actions.EvaluateActionHandler;
-import com.intellij.debugger.engine.evaluation.CodeFragmentFactory;
-import com.intellij.debugger.engine.evaluation.TextWithImports;
-import com.intellij.debugger.impl.PositionUtil;
-import com.intellij.debugger.settings.DebuggerSettings;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.CustomShortcutSet;
-import com.intellij.openapi.editor.Document;
-import com.intellij.openapi.editor.event.DocumentAdapter;
-import com.intellij.openapi.editor.event.DocumentEvent;
-import com.intellij.openapi.help.HelpManager;
-import com.intellij.openapi.project.Project;
-import com.intellij.openapi.ui.Splitter;
-import com.intellij.openapi.util.DimensionService;
-import com.intellij.psi.PsiDocumentManager;
-import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiFile;
-import com.intellij.psi.PsiWhiteSpace;
-import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-
-/**
- * @author lex
- */
-public class StatementEvaluationDialog extends EvaluationDialog{
-  private final JPanel myPanel;
-  private final Action mySwitchAction = new SwitchAction();
-  private static final @NonNls String STATEMENT_EDITOR_DIMENSION_KEY = "#com.intellij.debugger.ui.StatementEvaluationDialog.StatementEditor";
-  private static final @NonNls String EVALUATION_PANEL_DIMENSION_KEY = "#com.intellij.debugger.ui.StatementEvaluationDialog.EvaluationPanel";
-
-  public StatementEvaluationDialog(final Project project, TextWithImports text) {
-    super(project, text);
-    setTitle(DebuggerBundle.message("evaluate.statement.dialog.title"));
-    myPanel = new JPanel(new BorderLayout());
-
-    final Splitter splitter = new Splitter(true);
-    splitter.setHonorComponentsMinimumSize(true);
-
-    final JPanel editorPanel = new JPanel(new GridBagLayout());
-
-    final JLabel statementsLabel = new JLabel(DebuggerBundle.message("label.evaluation.dialog.statements"));
-    editorPanel.add(statementsLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
-    editorPanel.add(getStatementEditor(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(2, 0, 0, 0), 0, 0));
-
-    splitter.setFirstComponent(editorPanel);
-
-    final MyEvaluationPanel evaluationPanel = getEvaluationPanel();
-    final JPanel ep = new JPanel(new BorderLayout());
-    //final JLabel resultLabel = new JLabel(DebuggerBundle.message("label.evaluate.dialog.result"));
-    //ep.add(resultLabel, BorderLayout.NORTH);
-    ep.add(evaluationPanel, BorderLayout.CENTER);
-    splitter.setSecondComponent(ep);
-    final Dimension statementSize = DimensionService.getInstance().getSize(STATEMENT_EDITOR_DIMENSION_KEY, project);
-    final Dimension evaluationSize = DimensionService.getInstance().getSize(EVALUATION_PANEL_DIMENSION_KEY, project);
-    if (statementSize != null && evaluationSize != null) {
-      final float proportion = (float)statementSize.height / (float)(statementSize.height + evaluationSize.height);
-      splitter.setProportion(proportion);
-    }
-    myPanel.add(splitter, BorderLayout.CENTER);
-
-    setDebuggerContext(getDebuggerContext());
-
-    final KeyStroke codeFragment = KeyStroke.getKeyStroke(KeyEvent.VK_E,     KeyEvent.ALT_MASK);
-    final KeyStroke resultStroke = KeyStroke.getKeyStroke(KeyEvent.VK_R,     KeyEvent.ALT_MASK);
-    final KeyStroke altEnter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.CTRL_MASK);
-
-    final JRootPane rootPane = getRootPane();
-    final AnAction toStatementAction = new AnAction() {
-      public void actionPerformed(AnActionEvent e) {
-        getStatementEditor().requestFocus();
-      }
-    };
-    toStatementAction.registerCustomShortcutSet(new CustomShortcutSet(codeFragment), rootPane);
-    addDisposeRunnable(new Runnable() {
-      public void run() {
-        toStatementAction.unregisterCustomShortcutSet(rootPane);
-      }
-    });
-
-    final AnAction toEvaluationAction = new AnAction() {
-      public void actionPerformed(AnActionEvent e) {
-        getEvaluationPanel().getWatchTree().requestFocus();
-      }
-    };
-    toEvaluationAction.registerCustomShortcutSet(new CustomShortcutSet(resultStroke), rootPane);
-    addDisposeRunnable(new Runnable() {
-      public void run() {
-        toEvaluationAction.unregisterCustomShortcutSet(rootPane);
-      }
-    });
-
-    final AnAction okAction = new AnAction() {
-      public void actionPerformed(AnActionEvent e) {
-        doOKAction();
-      }
-    };
-    okAction.registerCustomShortcutSet(new CustomShortcutSet(altEnter), rootPane);
-    addDisposeRunnable(new Runnable() {
-      public void run() {
-        okAction.unregisterCustomShortcutSet(rootPane);
-      }
-    });
-
-    final DebuggerEditorImpl editor = getEditor();
-    final DocumentAdapter docListener = new DocumentAdapter() {
-      public void documentChanged(final DocumentEvent e) {
-        DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
-          public void run() {
-            updateSwitchButton(e.getDocument());
-          }
-        });
-      }
-    };
-    editor.addDocumentListener(docListener);
-    addDisposeRunnable(new Runnable() {
-      public void run() {
-        editor.removeDocumentListener(docListener);
-      }
-    });
-
-    init();
-  }
-
-  private void updateSwitchButton(Document document) {
-    PsiDocumentManager.getInstance(getProject()).commitDocument(document);
-    PsiFile psiFile = PsiDocumentManager.getInstance(getProject()).getPsiFile(document);
-    if (psiFile == null) {
-      return;
-    }
-    PsiElement[] children = psiFile.getChildren();
-    int nonWhite = 0;
-    for (PsiElement child : children) {
-      if (!(child instanceof PsiWhiteSpace)) {
-        nonWhite++;
-        if (nonWhite > 1) {
-          mySwitchAction.setEnabled(false);
-          return;
-        }
-      }
-    }
-
-    mySwitchAction.setEnabled(true);
-  }
-
-  @NotNull
-  protected Action[] createActions(){
-    return new Action[]{getOKAction(), getCancelAction(), mySwitchAction, getHelpAction() };
-  }
-
-  protected void doHelpAction() {
-    HelpManager.getInstance().invokeHelp(HelpID.EVALUATE);
-  }
-
-  protected DebuggerEditorImpl createEditor(final CodeFragmentFactory factory) {
-    return new DebuggerStatementEditor(getProject(), PositionUtil.getContextElement(getDebuggerContext()), "evaluation", factory);
-  }
-
-  public void dispose() {
-    try {
-      final DebuggerEditorImpl editor = getEditor();
-      final DimensionService dimensionService = DimensionService.getInstance();
-      dimensionService.setSize(STATEMENT_EDITOR_DIMENSION_KEY, editor.getSize(null), getProject());
-      dimensionService.setSize(EVALUATION_PANEL_DIMENSION_KEY, getEvaluationPanel().getSize(), getProject());
-    }
-    finally {
-      super.dispose();
-    }
-  }
-
-  protected JComponent createCenterPanel() {
-    return myPanel;
-  }
-
-  private DebuggerStatementEditor getStatementEditor() {
-    return (DebuggerStatementEditor)getEditor();
-  }
-
-  private class SwitchAction extends AbstractAction {
-    public SwitchAction() {
-      putValue(NAME, DebuggerBundle.message("action.evaluate.statement.dialog.switch.mode.description"));
-    }
-
-    public void actionPerformed(ActionEvent e) {
-      final TextWithImports text = getEditor().getText();
-      doCancelAction();
-      DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
-        public void run() {
-          EvaluateActionHandler.showEvaluationDialog(getProject(), text, DebuggerSettings.EVALUATE_EXPRESSION);
-        }
-      });
-    }
-  }
-
-
-}
index 1496110880584b1cfb6e9a56086f7969a7412353..208f77a1d8b5e2a6baa99ebe52e37148825b94a3 100644 (file)
       </action>
       <!--<action id="Debugger.SetValue" class="com.intellij.debugger.actions.SetValueAction"/>-->
       <!--<action id="Debugger.ShowAsHex" class="com.intellij.debugger.actions.ShowAsHexAction" text="Show as Hex"/>-->
-      <action id="Debugger.ShowFrame" class="com.intellij.debugger.actions.ShowFrameAction"/>
       <action id="Debugger.ResumeThread" class="com.intellij.debugger.actions.ResumeThreadAction"/>
       <action id="Debugger.FreezeThread" class="com.intellij.debugger.actions.FreezeThreadAction"/>
       <action id="Debugger.InterruptThread" class="com.intellij.debugger.actions.InterruptThreadAction"/>