com.intellij.openapi.actionSystem.DataConstantscom.intellij.openapi.actionSystem.DataKeys



Project JetBrains/intellij-community in file ...ges.editor.actionSystem.ImageEditorActionUtil.java (2007-08-18)
@@ -1,8 +1,8 @@
 package org.intellij.images.editor.actionSystem;
 
 import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
 import com.intellij.openapi.fileEditor.FileEditor;
 import org.intellij.images.editor.ImageEditor;
@@ -33,7 +33,7 @@ public final class ImageEditorActionUtil {
 
     public static ImageEditor getEditor(AnActionEvent e) {
         DataContext dataContext = e.getDataContext();
-        FileEditor editor = (FileEditor) dataContext.getData(DataConstants.FILE_EDITOR);
+      FileEditor editor = DataKeys.FILE_EDITOR.getData(dataContext);
         if (editor instanceof ImageFileEditor) {
             ImageFileEditor fileEditor = (ImageFileEditor) editor;
             return fileEditor.getImageEditor();
Project JetBrains/intellij-community in file ...tice.testng.ui.actions.RerunFailedTestsAction.java (2007-08-18)
@@ -13,8 +13,8 @@ import com.intellij.execution.testframework.AbstractTestProxy;
 import com.intellij.execution.testframework.Filter;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.project.Project;
@@ -61,7 +61,7 @@ public class RerunFailedTestsAction extends AnAction {
 
   private boolean isActive(AnActionEvent e) {
     DataContext dataContext = e.getDataContext();
-    Project project = (Project)dataContext.getData(DataConstants.PROJECT);
+    Project project = DataKeys.PROJECT.getData(dataContext);
     if (project == null) return false;
     if (myModel == null || myModel.getRoot() == null) return false;
     List<AbstractTestProxy> failed = getFailedTests();
Project JetBrains/intellij-community in file ...om.intellij.uiDesigner.palette.AddGroupAction.java (2006-11-01)
@@ -4,13 +4,13 @@
 
 package com.intellij.uiDesigner.palette;
 
+import com.intellij.CommonBundle;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
-import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
 import com.intellij.uiDesigner.UIDesignerBundle;
-import com.intellij.CommonBundle;
 
 import java.util.ArrayList;
 
@@ -19,7 +19,7 @@ import java.util.ArrayList;
  */
 public class AddGroupAction extends AnAction {
   public void actionPerformed(AnActionEvent e) {
-    Project project = (Project)e.getDataContext().getData(DataConstants.PROJECT);
+    Project project = e.getData(DataKeys.PROJECT);
     if (project == null) return;
     // Ask group name
     final String groupName = Messages.showInputDialog(
Project JetBrains/intellij-community in file ...l.com.intellij.ide.actions.CloneElementAction.java (2007-11-26)
@@ -1,7 +1,7 @@
 package com.intellij.ide.actions;
 
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.wm.ToolWindowId;
@@ -24,7 +24,7 @@ public class CloneElementAction extends CopyElementAction {
 
   protected void updateForToolWindow(String id, DataContext dataContext,Presentation presentation) {
     // work only with single selection
-    PsiElement[] elements = (PsiElement[])dataContext.getData(DataConstants.PSI_ELEMENT_ARRAY);
+    PsiElement[] elements = DataKeys.PSI_ELEMENT_ARRAY.getData(dataContext);
     presentation.setEnabled(elements != null && elements.length == 1 && CopyHandler.canCopy(elements));
     presentation.setVisible(true);
 
Project JetBrains/intellij-community in file ...impl.com.intellij.ide.actions.CopyPathsAction.java (2007-08-18)
@@ -1,13 +1,13 @@
 
 package com.intellij.ide.actions;
 
+import com.intellij.ide.IdeBundle;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
-import com.intellij.openapi.actionSystem.DataConstants;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.actionSystem.Presentation;
 import com.intellij.openapi.ide.CopyPasteManager;
 import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.ide.IdeBundle;
 
 import java.awt.datatransfer.StringSelection;
 
@@ -41,7 +41,7 @@ public class CopyPathsAction extends AnAction {
   }
 
   private static VirtualFile[] getFiles(AnActionEvent e) {
-    return (VirtualFile[])e.getDataContext().getData(DataConstants.VIRTUAL_FILE_ARRAY);
+    return DataKeys.VIRTUAL_FILE_ARRAY.getData(e.getDataContext());
   }
 
 }