mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
clean up. simplify getting project from data context
This commit is contained in:
@@ -34,9 +34,8 @@ public class AssociateFileTypeAction extends AnAction {
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
Presentation presentation = e.getPresentation();
|
||||
DataContext dataContext = e.getDataContext();
|
||||
VirtualFile file = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);
|
||||
Project project = CommonDataKeys.PROJECT.getData(dataContext);
|
||||
VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
|
||||
Project project = e.getProject();
|
||||
boolean haveSmthToDo;
|
||||
if (project == null || file == null || file.isDirectory()) {
|
||||
haveSmthToDo = false;
|
||||
|
||||
Reference in New Issue
Block a user