From f2a54832138da84e6d6dea134e7c04577a328b5e Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Sun, 3 Nov 2013 23:43:04 +0100 Subject: [PATCH] PlatformDataKeys -> CommonDataKeys --- .../openapi/vcs/changes/actions/AddChangeListAction.java | 9 +++------ .../vcs/changes/actions/OpenRepositoryVersionAction.java | 7 ++++--- .../vcs/changes/actions/ScheduleForAdditionAction.java | 8 ++++---- .../vcs/changes/actions/ShowDiffWithLocalAction.java | 7 ++++--- .../vcs/changes/committed/FilterCommittedAction.java | 7 ++++--- .../xdebugger/impl/actions/MuteBreakpointAction.java | 9 +++++---- .../plugins/xsltDebugger/ui/GeneratedStructureModel.java | 3 ++- .../jetbrains/rest/sphinx/RunSphinxQuickStartAction.java | 2 +- .../GenerateSchemaFromInstanceDocumentAction.java | 4 ++-- 9 files changed, 29 insertions(+), 27 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/AddChangeListAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/AddChangeListAction.java index 10d6264f5a09..47ebe6c024fd 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/AddChangeListAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/AddChangeListAction.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 @@ */ package com.intellij.openapi.vcs.changes.actions; -import com.intellij.openapi.actionSystem.ActionPlaces; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.PlatformDataKeys; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; @@ -38,7 +35,7 @@ import com.intellij.openapi.vcs.changes.ui.NewChangelistDialog; public class AddChangeListAction extends AnAction implements DumbAware { public void actionPerformed(AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); NewChangelistDialog dlg = new NewChangelistDialog(project); dlg.show(); if (dlg.getExitCode() == DialogWrapper.OK_EXIT_CODE) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/OpenRepositoryVersionAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/OpenRepositoryVersionAction.java index fdb4cd509d40..3bf3e72eb706 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/OpenRepositoryVersionAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/OpenRepositoryVersionAction.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. @@ -18,6 +18,7 @@ package com.intellij.openapi.vcs.changes.actions; 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.application.ModalityState; import com.intellij.openapi.fileEditor.OpenFileDescriptor; @@ -43,7 +44,7 @@ public class OpenRepositoryVersionAction extends AnAction implements DumbAware { } public void actionPerformed(AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); Change[] changes = e.getData(VcsDataKeys.SELECTED_CHANGES); assert changes != null; for(Change change: changes) { @@ -56,7 +57,7 @@ public class OpenRepositoryVersionAction extends AnAction implements DumbAware { } public void update(final AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); Change[] changes = e.getData(VcsDataKeys.SELECTED_CHANGES); e.getPresentation().setEnabled(project != null && changes != null && (! CommittedChangesBrowserUseCase.IN_AIR.equals(CommittedChangesBrowserUseCase.DATA_KEY.getData(e.getDataContext()))) && diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ScheduleForAdditionAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ScheduleForAdditionAction.java index 322060010171..b97df85b6560 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ScheduleForAdditionAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ScheduleForAdditionAction.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. @@ -59,7 +59,7 @@ public class ScheduleForAdditionAction extends AnAction implements DumbAware { if (unversionedFiles.isEmpty()) { return; } - final ChangeListManagerImpl changeListManager = ChangeListManagerImpl.getInstanceImpl(e.getData(PlatformDataKeys.PROJECT)); + final ChangeListManagerImpl changeListManager = ChangeListManagerImpl.getInstanceImpl(e.getData(CommonDataKeys.PROJECT)); changeListManager.addUnversionedFiles(changeListManager.getDefaultChangeList(), unversionedFiles); } @@ -69,7 +69,7 @@ public class ScheduleForAdditionAction extends AnAction implements DumbAware { return true; } VirtualFile[] files = getFromSelection(e); - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (files == null || project == null) { return false; } @@ -91,7 +91,7 @@ public class ScheduleForAdditionAction extends AnAction implements DumbAware { } final VirtualFile[] files = getFromSelection(e); - final Project project = e.getData(PlatformDataKeys.PROJECT); + final Project project = e.getData(CommonDataKeys.PROJECT); if (files == null || project == null) { return Collections.emptyList(); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ShowDiffWithLocalAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ShowDiffWithLocalAction.java index ac28b46a0666..470aeaf251a3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ShowDiffWithLocalAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/ShowDiffWithLocalAction.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. @@ -18,6 +18,7 @@ package com.intellij.openapi.vcs.changes.actions; 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.project.DumbAware; import com.intellij.openapi.project.Project; @@ -43,7 +44,7 @@ public class ShowDiffWithLocalAction extends AnAction implements DumbAware { } public void actionPerformed(AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (ChangeListManager.getInstance(project).isFreezedWithNotification(null)) return; Change[] changes = e.getData(VcsDataKeys.CHANGES); assert changes != null; @@ -61,7 +62,7 @@ public class ShowDiffWithLocalAction extends AnAction implements DumbAware { } public void update(final AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); Change[] changes = e.getData(VcsDataKeys.CHANGES); e.getPresentation().setEnabled(project != null && changes != null && diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/FilterCommittedAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/FilterCommittedAction.java index a279b71a5198..3608355a83ca 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/FilterCommittedAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/FilterCommittedAction.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. @@ -17,6 +17,7 @@ package com.intellij.openapi.vcs.changes.committed; 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.project.DumbAware; @@ -27,7 +28,7 @@ import com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager; */ public class FilterCommittedAction extends AnAction implements DumbAware { public void actionPerformed(AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { CommittedChangesPanel panel = ChangesViewContentManager.getInstance(project).getActiveComponent(CommittedChangesPanel.class); assert panel != null; @@ -36,7 +37,7 @@ public class FilterCommittedAction extends AnAction implements DumbAware { } public void update(final AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { CommittedChangesPanel panel = ChangesViewContentManager.getInstance(project).getActiveComponent(CommittedChangesPanel.class); e.getPresentation().setVisible(panel != null && panel.getRepositoryLocation() != null); diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java index f31f92662d62..4fc1bf2400f9 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/MuteBreakpointAction.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. @@ -16,6 +16,7 @@ package com.intellij.xdebugger.impl.actions; import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.actionSystem.ToggleAction; import com.intellij.openapi.project.Project; @@ -26,7 +27,7 @@ import com.intellij.xdebugger.impl.DebuggerSupport; */ public class MuteBreakpointAction extends ToggleAction { public boolean isSelected(final AnActionEvent e) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) { DebuggerToggleActionHandler handler = support.getMuteBreakpointsHandler(); @@ -39,7 +40,7 @@ public class MuteBreakpointAction extends ToggleAction { } public void setSelected(final AnActionEvent e, final boolean state) { - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) { DebuggerToggleActionHandler handler = support.getMuteBreakpointsHandler(); @@ -53,7 +54,7 @@ public class MuteBreakpointAction extends ToggleAction { public void update(final AnActionEvent e) { super.update(e); - Project project = e.getData(PlatformDataKeys.PROJECT); + Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { for (DebuggerSupport support : DebuggerSupport.getDebuggerSupports()) { DebuggerToggleActionHandler handler = support.getMuteBreakpointsHandler(); diff --git a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/ui/GeneratedStructureModel.java b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/ui/GeneratedStructureModel.java index 09fa9636e999..20f1942ed60f 100644 --- a/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/ui/GeneratedStructureModel.java +++ b/plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/ui/GeneratedStructureModel.java @@ -17,6 +17,7 @@ package org.intellij.plugins.xsltDebugger.ui; import com.intellij.ide.DataManager; +import com.intellij.openapi.actionSystem.CommonDataKeys; import com.intellij.openapi.actionSystem.PlatformDataKeys; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.project.Project; @@ -307,7 +308,7 @@ public class GeneratedStructureModel extends DefaultTreeModel { public void navigate(boolean requestFocus) { final OutputEventQueue.NodeEvent event = getUserObject(); - final Project project = (Project)DataManager.getInstance().getDataContext().getData(PlatformDataKeys.PROJECT.getName()); + final Project project = (Project)DataManager.getInstance().getDataContext().getData(CommonDataKeys.PROJECT.getName()); XsltDebuggerSession.openLocation(project, event.getURI(), event.getLineNumber() - 1); } diff --git a/python/python-rest/src/com/jetbrains/rest/sphinx/RunSphinxQuickStartAction.java b/python/python-rest/src/com/jetbrains/rest/sphinx/RunSphinxQuickStartAction.java index b599f71dcebf..10195c7b0cb3 100644 --- a/python/python-rest/src/com/jetbrains/rest/sphinx/RunSphinxQuickStartAction.java +++ b/python/python-rest/src/com/jetbrains/rest/sphinx/RunSphinxQuickStartAction.java @@ -39,7 +39,7 @@ public class RunSphinxQuickStartAction extends AnAction implements DumbAware { final Presentation presentation = RestPythonUtil.updateSphinxQuickStartRequiredAction(e); assert presentation.isEnabled() && presentation.isVisible() : "Sphinx requirements for action are not satisfied"; - final Project project = e.getData(PlatformDataKeys.PROJECT); + final Project project = e.getData(CommonDataKeys.PROJECT); if (project == null) return; diff --git a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.java b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.java index 615b74a4763a..76abf637945c 100644 --- a/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.java +++ b/xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateSchemaFromInstanceDocumentAction.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. @@ -68,7 +68,7 @@ public class GenerateSchemaFromInstanceDocumentAction extends AnAction { } public void actionPerformed(AnActionEvent e) { - final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext()); + final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); final VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(e.getDataContext()); final GenerateSchemaFromInstanceDocumentDialog dialog = new GenerateSchemaFromInstanceDocumentDialog(project, file);