public Object getData(@NonNls final String dataId) { if (PlatformDataKeys.PROJECT.is(dataId)) { return myProject; } if (PlatformDataKeys.VIRTUAL_FILE.is(dataId)) { final VirtualFile selectedFile = myWindow.getSelectedFile(); return selectedFile != null && selectedFile.isValid() ? selectedFile : null; } if (EditorWindow.DATA_KEY.is(dataId)) { return myWindow; } if (PlatformDataKeys.HELP_ID.is(dataId)) { return HELP_ID; } if (CloseAction.CloseTarget.KEY.is(dataId)) { TabInfo selected = myTabs.getSelectedInfo(); if (selected != null) { return EditorTabbedContainer.this; } } if (EditorWindow.DATA_KEY.is(dataId)) { return myWindow; } return null; }
@Override public Object getData(final String dataId) { final Editor e = validateCurrentEditor(); if (e == null) return null; if (!myProject.isDisposed()) { final Object o = ((FileEditorManagerImpl) FileEditorManager.getInstance(myProject)) .getData(dataId, e, myFile); if (o != null) return o; } if (PlatformDataKeys.EDITOR.is(dataId)) { return e; } if (PlatformDataKeys.VIRTUAL_FILE.is(dataId)) { return myFile.isValid() ? myFile : null; // fix for SCR 40329 } return null; }