From 2cab88d212c7bf85e6af711d44aa0d7b60d79210 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Sun, 3 Nov 2013 23:41:55 +0100 Subject: [PATCH] PlatformDataKeys -> CommonDataKeys --- .../com/intellij/debugger/ui/JavaDebuggerSupport.java | 9 +++------ .../configurations/JavaCommandLineState.java | 7 ++++--- .../lang/ant/config/actions/AntBuildGroup.java | 6 +++--- .../src/com/intellij/ide/actions/SyncViewsAction.java | 11 ++++------- .../idea/copyright/actions/UpdateCopyrightAction.java | 6 +++--- .../src/git4idea/ui/branch/GitBranchesAction.java | 4 ++-- 6 files changed, 19 insertions(+), 24 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java b/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java index 370673aaf7ed..e021d76b271b 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/JavaDebuggerSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 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,10 +22,7 @@ import com.intellij.debugger.settings.*; import com.intellij.debugger.ui.breakpoints.*; import com.intellij.ide.DataManager; import com.intellij.openapi.Disposable; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.markup.GutterIconRenderer; import com.intellij.openapi.editor.markup.RangeHighlighter; @@ -338,7 +335,7 @@ public class JavaDebuggerSupport extends DebuggerSupport { public static Project getCurrentProject() { //todo[nik] improve - Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()); + Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()); if (project != null) { return project; } diff --git a/java/execution/openapi/src/com/intellij/execution/configurations/JavaCommandLineState.java b/java/execution/openapi/src/com/intellij/execution/configurations/JavaCommandLineState.java index e0c60ee3846d..bab671678c57 100644 --- a/java/execution/openapi/src/com/intellij/execution/configurations/JavaCommandLineState.java +++ b/java/execution/openapi/src/com/intellij/execution/configurations/JavaCommandLineState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -19,7 +19,7 @@ import com.intellij.execution.ExecutionException; import com.intellij.execution.process.OSProcessHandler; import com.intellij.execution.runners.ExecutionEnvironment; import com.intellij.ide.DataManager; -import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.actionSystem.CommonDataKeys; import org.jetbrains.annotations.NotNull; @@ -49,7 +49,8 @@ public abstract class JavaCommandLineState extends CommandLineState implements J protected abstract JavaParameters createJavaParameters() throws ExecutionException; protected GeneralCommandLine createCommandLine() throws ExecutionException { - return CommandLineBuilder.createFromJavaParameters(getJavaParameters(), PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true); + return CommandLineBuilder.createFromJavaParameters(getJavaParameters(), CommonDataKeys.PROJECT + .getData(DataManager.getInstance().getDataContext()), true); } public boolean shouldAddJavaProgramRunnerActions() { diff --git a/plugins/ant/src/com/intellij/lang/ant/config/actions/AntBuildGroup.java b/plugins/ant/src/com/intellij/lang/ant/config/actions/AntBuildGroup.java index 3f664f2c9720..529d78e6924f 100644 --- a/plugins/ant/src/com/intellij/lang/ant/config/actions/AntBuildGroup.java +++ b/plugins/ant/src/com/intellij/lang/ant/config/actions/AntBuildGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -31,7 +31,7 @@ import java.util.Set; public final class AntBuildGroup extends ActionGroup implements DumbAware { public void update(AnActionEvent event) { - Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext()); + Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); Presentation presentation = event.getPresentation(); presentation.setEnabled(project != null); presentation.setVisible(project != null); @@ -40,7 +40,7 @@ public final class AntBuildGroup extends ActionGroup implements DumbAware { @NotNull public AnAction[] getChildren(@Nullable AnActionEvent e) { if (e == null) return AnAction.EMPTY_ARRAY; - Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext()); + Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); if (project == null) return AnAction.EMPTY_ARRAY; final List children = new ArrayList(); diff --git a/plugins/commander/src/com/intellij/ide/actions/SyncViewsAction.java b/plugins/commander/src/com/intellij/ide/actions/SyncViewsAction.java index ffe2dab7fd23..5ba99b554395 100644 --- a/plugins/commander/src/com/intellij/ide/actions/SyncViewsAction.java +++ b/plugins/commander/src/com/intellij/ide/actions/SyncViewsAction.java @@ -1,6 +1,6 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -17,17 +17,14 @@ package com.intellij.ide.actions; import com.intellij.ide.commander.Commander; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.PlatformDataKeys; -import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.Project; import com.intellij.openapi.wm.ToolWindowId; import com.intellij.openapi.wm.ToolWindowManager; public class SyncViewsAction extends AnAction { public void actionPerformed(AnActionEvent e) { - Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext()); + Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); if (project == null) { return; } @@ -35,7 +32,7 @@ public class SyncViewsAction extends AnAction { } public void update(AnActionEvent event){ Presentation presentation = event.getPresentation(); - Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext()); + Project project = CommonDataKeys.PROJECT.getData(event.getDataContext()); if (project == null) { presentation.setEnabled(false); return; diff --git a/plugins/copyright/src/com/maddyhome/idea/copyright/actions/UpdateCopyrightAction.java b/plugins/copyright/src/com/maddyhome/idea/copyright/actions/UpdateCopyrightAction.java index 03c256722490..db0101803a22 100644 --- a/plugins/copyright/src/com/maddyhome/idea/copyright/actions/UpdateCopyrightAction.java +++ b/plugins/copyright/src/com/maddyhome/idea/copyright/actions/UpdateCopyrightAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -41,7 +41,7 @@ public class UpdateCopyrightAction extends AnAction { private static boolean isEnabled(AnActionEvent event) { final DataContext context = event.getDataContext(); - final Project project = PlatformDataKeys.PROJECT.getData(context); + final Project project = CommonDataKeys.PROJECT.getData(context); if (project == null) { return false; } @@ -96,7 +96,7 @@ public class UpdateCopyrightAction extends AnAction { public void actionPerformed(AnActionEvent event) { final DataContext context = event.getDataContext(); - final Project project = PlatformDataKeys.PROJECT.getData(context); + final Project project = CommonDataKeys.PROJECT.getData(context); assert project != null; final Module module = LangDataKeys.MODULE.getData(context); diff --git a/plugins/git4idea/src/git4idea/ui/branch/GitBranchesAction.java b/plugins/git4idea/src/git4idea/ui/branch/GitBranchesAction.java index d98dcdb2c63e..67cc2184e3bf 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/GitBranchesAction.java +++ b/plugins/git4idea/src/git4idea/ui/branch/GitBranchesAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2011 JetBrains s.r.o. + * Copyright 2000-2013 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. @@ -37,7 +37,7 @@ public class GitBranchesAction extends DumbAwareAction { @Override public void actionPerformed(AnActionEvent e) { - final Project project = e.getData(PlatformDataKeys.PROJECT); + final Project project = e.getData(CommonDataKeys.PROJECT); assert project != null; GitRepositoryManager repositoryManager = GitUtil.getRepositoryManager(project); VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);