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
-6
@@ -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) {
|
||||
|
||||
+4
-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.
|
||||
@@ -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()))) &&
|
||||
|
||||
+4
-4
@@ -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();
|
||||
}
|
||||
|
||||
+4
-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.
|
||||
@@ -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 &&
|
||||
|
||||
+4
-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.
|
||||
@@ -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);
|
||||
|
||||
+5
-4
@@ -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();
|
||||
|
||||
+2
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+2
-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.
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user