PlatformDataKeys -> CommonDataKeys

This commit is contained in:
Konstantin Bulenkov
2013-11-03 23:41:55 +01:00
parent 7c2e72142c
commit 2cab88d212
6 changed files with 19 additions and 24 deletions
@@ -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;
}
@@ -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() {
@@ -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<AnAction> children = new ArrayList<AnAction>();
@@ -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;
@@ -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);
@@ -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);