com.intellij.openapi.actionSystem.DataConstantscom.intellij.openapi.actionSystem.LangDataKeys



Project JetBrains/intellij-community in file ...j.openapi.roots.ui.configuration.ModuleEditor.java (2009-12-28)
@@ -17,8 +17,8 @@ package com.intellij.openapi.roots.ui.configuration;
 
 import com.intellij.facet.impl.ProjectFacetsConfigurator;
 import com.intellij.openapi.Disposable;
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataProvider;
+import com.intellij.openapi.actionSystem.LangDataKeys;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleConfigurationEditor;
@@ -556,7 +556,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
     }
 
     public Object getData(String dataId) {
-      if (dataId.equals(DataConstants.MODULE_CONTEXT)) {
+      if (LangDataKeys.MODULE_CONTEXT.is(dataId)) {
         return getModule();
       }
       return null;
Project JetBrains/intellij-community in file ...toring.wrapreturnvalue.WrapReturnValueHandler.java (2009-12-28)
@@ -16,8 +16,8 @@
 package com.intellij.refactoring.wrapreturnvalue;
 
 import com.intellij.ide.util.SuperMethodWarningUtil;
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.LangDataKeys;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.editor.CaretModel;
 import com.intellij.openapi.editor.Editor;
@@ -42,7 +42,7 @@ class WrapReturnValueHandler implements RefactoringActionHandler {
                        DataContext dataContext){
         final ScrollingModel scrollingModel = editor.getScrollingModel();
         scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE);
-        final PsiElement element = (PsiElement) dataContext.getData(DataConstants.PSI_ELEMENT);
+        final PsiElement element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
         PsiMethod selectedMethod = null;
         if(element instanceof PsiMethod){
             selectedMethod = (PsiMethod) element;
Project JetBrains/intellij-community in file ...ectView.actions.MoveModulesOutsideGroupAction.java (2009-12-28)
@@ -22,8 +22,8 @@ package com.intellij.ide.projectView.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.DataContext;
+import com.intellij.openapi.actionSystem.LangDataKeys;
 import com.intellij.openapi.module.Module;
 
 public class MoveModulesOutsideGroupAction extends AnAction {
@@ -34,7 +34,7 @@ public class MoveModulesOutsideGroupAction extends AnAction {
 
   public void actionPerformed(AnActionEvent e) {
     final DataContext dataContext = e.getDataContext();
-    final Module[] modules = (Module[])dataContext.getData(DataConstants.MODULE_CONTEXT_ARRAY);
+    final Module[] modules = LangDataKeys.MODULE_CONTEXT_ARRAY.getData(dataContext);
     MoveModulesToGroupAction.doMove(modules, null, dataContext);
   }
 }
\ No newline at end of file
Project JetBrains/intellij-community in file ...oovy.refactoring.rename.PropertyRenameHandler.java (2009-12-28)
@@ -15,8 +15,8 @@
  */
 package org.jetbrains.plugins.groovy.refactoring.rename;
 
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.LangDataKeys;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.project.Project;
@@ -44,7 +44,7 @@ public class PropertyRenameHandler implements RenameHandler {
 
   @Nullable
   private static GrField getProperty(DataContext dataContext) {
-    final PsiElement element = (PsiElement)dataContext.getData(DataConstants.PSI_ELEMENT);
+    final PsiElement element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
     if (element instanceof GrField && ((GrField)element).isProperty()) return (GrField)element;
     if (element instanceof GrAccessorMethod) return ((GrAccessorMethod)element).getProperty();
     return null;
Project JetBrains/intellij-community in file ...m.intellij.ide.impl.dataRules.PasteTargetRule.java (2009-12-28)
@@ -16,12 +16,11 @@
 
 package com.intellij.ide.impl.dataRules;
 
-import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataProvider;
+import com.intellij.openapi.actionSystem.LangDataKeys;
 
 public class PasteTargetRule implements GetDataRule {
   public Object getData(DataProvider dataProvider) {
-    Object data = dataProvider.getData(DataConstants.PSI_ELEMENT);
-    return data;
+    return LangDataKeys.PSI_ELEMENT.getData(dataProvider);
   }
 }