Skip to content

Commit

Permalink
fix yellow code producing by CommonDataKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
bulenkov committed Oct 1, 2013
1 parent 10c7d44 commit 9ecde9f
Showing 484 changed files with 1,079 additions and 798 deletions.
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
@@ -47,7 +48,7 @@
*/
public final class EditExternallyAction extends AnAction {
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
Project project = e.getData(CommonDataKeys.PROJECT);
VirtualFile[] files = e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);
Options options = OptionsManager.getInstance().getOptions();
String executablePath = options.getExternalEditorOptions().getExecutablePath();
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@
import com.intellij.openapi.actionSystem.ActionPlaces;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
@@ -31,7 +32,7 @@
*/
public final class ShowThumbnailsAction extends AnAction {
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
Project project = e.getData(CommonDataKeys.PROJECT);
VirtualFile file = e.getData(PlatformDataKeys.VIRTUAL_FILE);
if (project != null && file != null && file.isDirectory()) {
ThumbnailManager thumbnailManager = ThumbnailManager.getManager(project);
Original file line number Diff line number Diff line change
@@ -359,7 +359,7 @@ public void invokePopup(Component comp, int x, int y) {
@Nullable
public Object getData(String dataId) {

if (PlatformDataKeys.PROJECT.is(dataId)) {
if (CommonDataKeys.PROJECT.is(dataId)) {
return editor.getProject();
} else if (PlatformDataKeys.VIRTUAL_FILE.is(dataId)) {
return editor.getFile();
Original file line number Diff line number Diff line change
@@ -413,7 +413,7 @@ public void mouseClicked(MouseEvent e) {

@Nullable
public Object getData(String dataId) {
if (PlatformDataKeys.PROJECT.is(dataId)) {
if (CommonDataKeys.PROJECT.is(dataId)) {
return thumbnailView.getProject();
} else if (PlatformDataKeys.VIRTUAL_FILE.is(dataId)) {
VirtualFile[] selectedFiles = getSelectedFiles();
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ public void update(AnActionEvent event) {
presentation.setText(ActionsBundle.actionText(IdeActions.ACTION_COMPILE));
presentation.setVisible(true);

Project project = PlatformDataKeys.PROJECT.getData(dataContext);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
presentation.setEnabled(false);
return;
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
public abstract class CompileActionBase extends AnAction implements DumbAware {
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = e.getData(PlatformDataKeys.PROJECT);
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
return;
}
@@ -43,7 +43,7 @@ public void actionPerformed(AnActionEvent e) {

public void update(final AnActionEvent e) {
super.update(e);
final Project project = e.getData(PlatformDataKeys.PROJECT);
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
e.getPresentation().setEnabled(false);
}
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
package com.intellij.compiler.actions;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.Presentation;
@@ -34,6 +35,6 @@ public void update(AnActionEvent event){
if (!presentation.isEnabled()) {
return;
}
presentation.setEnabled(PlatformDataKeys.PROJECT.getData(event.getDataContext()) != null);
presentation.setEnabled(CommonDataKeys.PROJECT.getData(event.getDataContext()) != null);
}
}
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

import com.intellij.history.LocalHistory;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.Presentation;
@@ -46,7 +47,7 @@ public void update(AnActionEvent event) {
if (!presentation.isEnabled()) {
return;
}
Project project = PlatformDataKeys.PROJECT.getData(event.getDataContext());
Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
presentation.setEnabled(project != null);
}
}
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ public void actionPerformed(final AnActionEvent e) {
final String[] text = messageElement.getText();
final String id = text[0].substring(1, text[0].indexOf("]"));
final SuppressFix suppressInspectionFix = getSuppressAction(id);
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
assert project != null;
final OpenFileDescriptor navigatable = (OpenFileDescriptor)messageElement.getNavigatable();
final PsiFile file = PsiManager.getInstance(project).findFile(navigatable.getFile());
@@ -101,7 +101,7 @@ public void update(final AnActionEvent e) {
final Presentation presentation = e.getPresentation();
presentation.setVisible(false);
presentation.setEnabled(false);
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.options.ShowSettingsUtil;
@@ -34,7 +35,7 @@ public CompilerPropertiesAction() {
}

public void actionPerformed(AnActionEvent e) {
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project != null) {
ShowSettingsUtil.getInstance().editConfigurable(project, new CompilerConfigurable(project));
}
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import com.intellij.compiler.impl.javaCompiler.BackendCompiler;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.compiler.CompileContext;
import com.intellij.openapi.compiler.CompileStatusNotification;
@@ -36,12 +37,12 @@
public class CompilerPerfTestAction extends AnAction {
@Override
public void update(AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
Project project = e.getData(CommonDataKeys.PROJECT);
e.getPresentation().setEnabled(project != null);
}

public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(PlatformDataKeys.PROJECT);
final Project project = e.getData(CommonDataKeys.PROJECT);

final CompilerManager compilerManager = CompilerManager.getInstance(project);

Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.compiler.CompilerBundle;
import com.intellij.openapi.compiler.CompilerManager;
@@ -39,7 +40,7 @@ public PackageFileAction() {
@Override
public void update(AnActionEvent e) {
boolean visible = false;
final Project project = e.getData(PlatformDataKeys.PROJECT);
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project != null) {
final List<VirtualFile> files = getFilesToPackage(e, project);
if (!files.isEmpty()) {
@@ -77,7 +78,7 @@ private static List<VirtualFile> getFilesToPackage(@NotNull AnActionEvent e, @No

@Override
public void actionPerformed(AnActionEvent event) {
final Project project = event.getData(PlatformDataKeys.PROJECT);
final Project project = event.getData(CommonDataKeys.PROJECT);
if (project == null) return;

FileDocumentManager.getInstance().saveAllDocuments();
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl;
import com.intellij.debugger.ui.tree.ValueDescriptor;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.Presentation;
@@ -49,7 +50,7 @@ public void actionPerformed(AnActionEvent e) {
if (value == null) {
return;
}
final Project project = PlatformDataKeys.PROJECT.getData(actionContext);
final Project project = CommonDataKeys.PROJECT.getData(actionContext);
final DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
if(debuggerManager == null) {
return;
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
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.actionSystem.PlatformDataKeys;
import com.intellij.openapi.options.CompositeConfigurable;
import com.intellij.openapi.options.Configurable;
@@ -43,7 +44,7 @@
*/
public class CustomizeContextViewAction extends DebuggerAction{
public void actionPerformed(AnActionEvent e) {
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());

Disposable disposable = Disposer.newDisposable();
final CompositeConfigurable configurable = new TabbedConfigurable(disposable) {
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import com.intellij.debugger.settings.ThreadsViewSettings;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.options.ex.SingleConfigurableEditor;
import com.intellij.openapi.project.Project;
@@ -30,7 +31,7 @@
*/
public class CustomizeThreadsViewAction extends DebuggerAction {
public void actionPerformed(AnActionEvent e) {
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
final SingleConfigurableEditor editor = new SingleConfigurableEditor(project, new ThreadsViewConfigurable(ThreadsViewSettings.getInstance()));
editor.show();
}
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@ public static DebuggerContextImpl getDebuggerContext(DataContext dataContext) {
if(panel != null) {
return panel.getContext();
} else {
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
return project != null ? (DebuggerManagerEx.getInstanceEx(project)).getContext() : DebuggerContextImpl.EMPTY_CONTEXT;
}
}
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@

public class EditSourceAction extends DebuggerAction{
public void actionPerformed(AnActionEvent e) {
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());

if(project == null) return;

@@ -84,7 +84,7 @@ public SourcePosition compute() {
}

public void update(AnActionEvent e) {
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());

final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
final DebuggerTreeNodeImpl node = getSelectedNode(e.getDataContext());
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.debugger.ui.impl.watch.WatchItemDescriptor;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;

@@ -33,7 +34,7 @@ public void actionPerformed(final AnActionEvent e) {
final DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
if(selectedNode == null || !(selectedNode.getDescriptor() instanceof WatchItemDescriptor)) return;

Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());

MainWatchPanel watchPanel = DebuggerPanelsManager.getInstance(project).getWatchPanel();
if(watchPanel != null) {
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
@@ -42,7 +43,7 @@

public class ExportThreadsAction extends AnAction implements AnAction.TransparentUpdate {
public void actionPerformed(AnActionEvent e) {
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if (project == null) {
return;
}
@@ -78,7 +79,7 @@ public void actionPerformed(AnActionEvent e) {

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;
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
@@ -33,7 +34,7 @@ public void actionPerformed(AnActionEvent e) {
}

protected static void doAction(DataContext dataContext) {
final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
if(project == null) return;
StackFrameDescriptorImpl stackFrameDescriptor = getStackFrameDescriptor(dataContext);
if(stackFrameDescriptor != null) {
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
import com.intellij.debugger.ui.HotSwapUI;
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.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
@@ -32,7 +33,7 @@ public class HotSwapAction extends AnAction{

public void actionPerformed(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if(project == null) {
return;
}
@@ -47,7 +48,7 @@ public void actionPerformed(AnActionEvent e) {

public void update(AnActionEvent e) {
DataContext dataContext = e.getDataContext();
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if(project == null) {
e.getPresentation().setEnabled(false);
return;
Original file line number Diff line number Diff line change
@@ -33,14 +33,15 @@
import com.intellij.debugger.ui.impl.watch.*;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.sun.jdi.Field;

public class InspectAction extends DebuggerAction {
public void actionPerformed(AnActionEvent e) {
final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
final DebuggerTreeNodeImpl node = getSelectedNode(e.getDataContext());
if(node == null) return;
final NodeDescriptorImpl descriptor = node.getDescriptor();
Original file line number Diff line number Diff line change
@@ -23,12 +23,13 @@
import com.intellij.debugger.ui.DebuggerPanelsManager;
import com.intellij.debugger.ui.impl.MainWatchPanel;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.project.Project;

public class NewWatchAction extends DebuggerAction {
public void actionPerformed(final AnActionEvent e) {
Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
if(project == null) return;

final MainWatchPanel watchPanel = DebuggerPanelsManager.getInstance(project).getWatchPanel();
Loading

0 comments on commit 9ecde9f

Please sign in to comment.