res = (Project) getData(component, CommonDataKeys.PROJECT.getName());
}
else {
IdeFrame[] frames = WindowManagerEx.getInstanceEx().getAllProjectFrames();
for (IdeFrame frame : frames) {
final IdeFrameImpl eachFrame = (IdeFrameImpl)frame;
if (eachFrame.isActive()) {
res = eachFrame.getProject();
if (res != null) break;
}
}
}