com.intellij.openapi.actionSystem.DataKeys



Project JetBrains/intellij-community in file ...i.roots.ui.configuration.ContentEntriesEditor.java (2007-11-12)
@@ -5,6 +5,7 @@ import com.intellij.ide.util.JavaUtil;
 import com.intellij.ide.util.projectWizard.ToolbarPanel;
 import com.intellij.openapi.Disposable;
 import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.actionSystem.DefaultActionGroup;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.fileChooser.FileChooser;
@@ -438,7 +439,7 @@ public class ContentEntriesEditor extends ModuleElementsEditor {
           validateContentEntriesCandidates(files);
         }
       };
-      myDescriptor.setContextModule(getModule());
+      myDescriptor.putUserData(DataKeys.MODULE_CONTEXT, getModule());
       myDescriptor.setTitle(ProjectBundle.message("module.paths.add.content.title"));
       myDescriptor.setDescription(ProjectBundle.message("module.paths.add.content.prompt"));
     }
Project JetBrains/intellij-community in file ...pi.diff.actions.CompareClipboardWithSelection.java (2007-11-11)
@@ -1,7 +1,6 @@
 package com.intellij.openapi.diff.actions;
 
 import com.intellij.openapi.actionSystem.DataContext;
-import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
 import com.intellij.openapi.diff.*;
 import com.intellij.openapi.editor.Document;
@@ -22,7 +21,7 @@ public class CompareClipboardWithSelection extends BaseDiffAction {
   protected DiffRequest getDiffData(DataContext dataContext) {
     Project project = PlatformDataKeys.PROJECT.getData(dataContext);
     if (project == null) return null;
-    Editor editorData = DataKeys.EDITOR.getData(dataContext);
+    Editor editorData = PlatformDataKeys.EDITOR.getData(dataContext);
     Editor editor = editorData != null ? editorData : FileEditorManager.getInstance(project).getSelectedTextEditor();
     if (editor == null) return null;
     return new ClipboardSelectionContents(editor, project);
Project JetBrains/intellij-community in file ...om.intellij.ide.navigationToolbar.NavBarModel.java (2007-08-18)
@@ -9,6 +9,7 @@ import com.intellij.ide.IdeBundle;
 import com.intellij.lang.StdLanguages;
 import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleManager;
 import com.intellij.openapi.module.ModuleUtil;
@@ -89,7 +90,7 @@ public class NavBarModel {
       return updateModel(psiElement);
     }
     else {
-      final Module module = (Module)dataContext.getData(DataConstants.MODULE_CONTEXT);
+      final Module module = DataKeys.MODULE_CONTEXT.getData(dataContext);
       if (module != null) {
         if (size() == 1 && getElement(0) == module) { //no need to update
           return false;
Project JetBrains/intellij-community in file ...5/ui.impl.com.intellij.ide.macro.MacroManager.java (2007-08-18)
@@ -6,6 +6,7 @@ import com.intellij.ide.IdeEventQueue;
 import com.intellij.ide.impl.DataManagerImpl;
 import com.intellij.openapi.actionSystem.DataConstants;
 import com.intellij.openapi.actionSystem.DataContext;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.components.ServiceManager;
 import com.intellij.openapi.fileEditor.FileEditor;
 import com.intellij.openapi.fileEditor.FileEditorManager;
@@ -90,7 +91,7 @@ public final class MacroManager {
 
   private static DataContext getCorrectContext(DataContext dataContext) {
     if (dataContext.getData(DataConstants.FILE_EDITOR) != null) return dataContext;
-    Project project = (Project)dataContext.getData(DataConstants.PROJECT);
+    Project project = DataKeys.PROJECT.getData(dataContext);
     if (project == null) return dataContext;
     FileEditorManager editorManager = FileEditorManager.getInstance(project);
     VirtualFile[] files = editorManager.getSelectedFiles();
Project JetBrains/intellij-community in file ...pl.com.intellij.openapi.wm.impl.WindowWatcher.java (2007-08-18)
@@ -2,6 +2,7 @@ package com.intellij.openapi.wm.impl;
 
 import com.intellij.ide.DataManager;
 import com.intellij.openapi.actionSystem.DataConstants;
+import com.intellij.openapi.actionSystem.DataKeys;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
@@ -68,7 +69,7 @@ public final class WindowWatcher implements PropertyChangeListener{
         myWindow2Info.put(window,new WindowInfo(window, true));
       }
       myFocusedWindow=window;
-      final Project project = (Project)DataManager.getInstance().getDataContext(myFocusedWindow).getData(DataConstants.PROJECT);
+      final Project project = DataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(myFocusedWindow));
       for (Iterator i = myFocusedWindows.iterator(); i.hasNext();) {
         final Window w = (Window)i.next();
         if (project==DataManager.getInstance().getDataContext(w).getData(DataConstants.PROJECT)) {