mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PlatformDataKeys -> CommonDataKeys
This commit is contained in:
+3
-3
@@ -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);
|
||||
|
||||
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user