PlatformDataKeys -> CommonDataKeys

This commit is contained in:
Konstantin Bulenkov
2013-11-03 23:40:08 +01:00
parent bd64990942
commit 995e7f012e
2 changed files with 6 additions and 5 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.
@@ -125,14 +125,14 @@ public abstract class EditorAction extends AnAction implements DumbAware {
}
private static DataContext getProjectAwareDataContext(final Editor editor, @NotNull final DataContext original) {
if (PlatformDataKeys.PROJECT.getData(original) == editor.getProject()) {
if (CommonDataKeys.PROJECT.getData(original) == editor.getProject()) {
return original;
}
return new DataContext() {
@Override
public Object getData(String dataId) {
if (PlatformDataKeys.PROJECT.is(dataId)) {
if (CommonDataKeys.PROJECT.is(dataId)) {
return editor.getProject();
}
return original.getData(dataId);
@@ -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.
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.editor.actionSystem;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.application.ApplicationManager;
@@ -30,7 +31,7 @@ public abstract class EditorWriteActionHandler extends EditorActionHandler {
if (editor.isViewer()) return;
if (dataContext != null) {
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project != null && !FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)) return;
}