diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/CustomizeContextViewAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/CustomizeContextViewAction.java index 3ee721227591..178906b69735 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/CustomizeContextViewAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/CustomizeContextViewAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -22,7 +22,6 @@ import com.intellij.debugger.settings.NodeRendererSettings; import com.intellij.idea.ActionsBundle; import com.intellij.openapi.Disposable; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.options.Configurable; import com.intellij.openapi.options.ConfigurationException; import com.intellij.openapi.options.TabbedConfigurable; @@ -49,7 +48,7 @@ public class CustomizeContextViewAction extends XDebuggerTreeActionBase { @Override protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) { - final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); + final Project project = e.getProject(); Disposable disposable = Disposer.newDisposable(); final MyTabbedConfigurable configurable = new MyTabbedConfigurable(disposable); SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable) { diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/EditSourceAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/EditSourceAction.java index da7725f88a91..dec60411ee1a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/EditSourceAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/EditSourceAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -26,14 +26,17 @@ import com.intellij.debugger.impl.DebuggerSession; import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl; import com.intellij.debugger.ui.impl.watch.WatchItemDescriptor; -import com.intellij.openapi.actionSystem.*; +import com.intellij.openapi.actionSystem.ActionManager; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.IdeActions; +import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Computable; public class EditSourceAction extends DebuggerAction{ public void actionPerformed(AnActionEvent e) { - final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); + final Project project = e.getProject(); if(project == null) { return; @@ -89,7 +92,7 @@ public class EditSourceAction extends DebuggerAction{ } public void update(AnActionEvent e) { - final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); + final Project project = e.getProject(); final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext()); final DebuggerTreeNodeImpl node = getSelectedNode(e.getDataContext()); diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java index 011a7afe4e3c..1dd711a4ecea 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ExportThreadsAction.java @@ -24,7 +24,6 @@ import com.intellij.debugger.impl.DebuggerSession; import com.intellij.ide.actions.ExportToTextFileAction; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; @@ -36,7 +35,7 @@ import java.util.List; public class ExportThreadsAction extends AnAction implements AnAction.TransparentUpdate { public void actionPerformed(AnActionEvent e) { - final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); + final Project project = e.getProject(); if (project == null) { return; } @@ -58,9 +57,9 @@ public class ExportThreadsAction extends AnAction implements AnAction.Transparen } } - public void update(AnActionEvent event){ - Presentation presentation = event.getPresentation(); - Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); + public void update(AnActionEvent e){ + Presentation presentation = e.getPresentation(); + Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/HotSwapAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/HotSwapAction.java index db2c6b124b96..677b3e179c27 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/HotSwapAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/HotSwapAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2015 JetBrains s.r.o. + * Copyright 2000-2016 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. @@ -22,8 +22,6 @@ import com.intellij.debugger.ui.HotSwapUI; import com.intellij.debugger.ui.HotSwapUIImpl; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.project.Project; /** @@ -32,12 +30,7 @@ import com.intellij.openapi.project.Project; public class HotSwapAction extends AnAction{ public void actionPerformed(AnActionEvent e) { - DataContext dataContext = e.getDataContext(); - Project project = CommonDataKeys.PROJECT.getData(dataContext); - if(project == null) { - return; - } - + Project project = e.getProject(); DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project); DebuggerSession session = debuggerManager.getContext().getDebuggerSession(); @@ -47,9 +40,8 @@ public class HotSwapAction extends AnAction{ } public void update(AnActionEvent e) { - DataContext dataContext = e.getDataContext(); - Project project = CommonDataKeys.PROJECT.getData(dataContext); - if(project == null) { + Project project = e.getProject(); + if (project == null) { e.getPresentation().setEnabled(false); return; } diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java index 7ad087cbd75a..0a36f8b13a56 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ThreadDumpAction.java @@ -26,7 +26,6 @@ import com.intellij.debugger.impl.DebuggerUtilsEx; import com.intellij.debugger.jdi.VirtualMachineProxyImpl; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; @@ -46,7 +45,7 @@ import java.util.Map; public class ThreadDumpAction extends AnAction implements AnAction.TransparentUpdate { public void actionPerformed(AnActionEvent e) { - final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); + final Project project = e.getProject(); if (project == null) { return; } @@ -321,9 +320,9 @@ public class ThreadDumpAction extends AnAction implements AnAction.TransparentUp } - public void update(AnActionEvent event){ - Presentation presentation = event.getPresentation(); - Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); + public void update(AnActionEvent e){ + Presentation presentation = e.getPresentation(); + Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return;