mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
+ getProject(e)
This commit is contained in:
-6
@@ -90,10 +90,4 @@ public class NewModuleAction extends AnAction implements DumbAware {
|
||||
super.update(e);
|
||||
e.getPresentation().setEnabled(getProject(e) != null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Project getProject(AnActionEvent e) {
|
||||
return e.getData(PlatformDataKeys.PROJECT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-4
@@ -74,8 +74,4 @@ public abstract class LocalHistoryAction extends AnAction implements DumbAware {
|
||||
}
|
||||
return commonParent;
|
||||
}
|
||||
|
||||
protected Project getProject(AnActionEvent e) {
|
||||
return e.getData(PlatformDataKeys.PROJECT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,12 @@ package com.intellij.openapi.actionSystem;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
@@ -302,4 +304,9 @@ public abstract class AnAction {
|
||||
public interface TransparentUpdate {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Project getProject(AnActionEvent e) {
|
||||
return e == null ? null : e.getData(PlatformDataKeys.PROJECT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,9 +48,6 @@ public class ApplySwitchAction extends AnAction {
|
||||
}
|
||||
}
|
||||
|
||||
private static Project getProject(AnActionEvent e) {
|
||||
return PlatformDataKeys.PROJECT.getData(e.getDataContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
|
||||
-4
@@ -30,8 +30,4 @@ public class ShowFeatureUsageStatisticsAction extends AnAction implements DumbAw
|
||||
super.update(e);
|
||||
e.getPresentation().setEnabled(getProject(e) != null);
|
||||
}
|
||||
|
||||
private Project getProject(AnActionEvent e) {
|
||||
return PlatformDataKeys.PROJECT.getData(e.getDataContext());
|
||||
}
|
||||
}
|
||||
@@ -73,10 +73,6 @@ public class SynchronizeCurrentFileAction extends AnAction implements DumbAware
|
||||
WindowManager.getInstance().getStatusBar(project).setInfo(message);
|
||||
}
|
||||
|
||||
private static Project getProject(AnActionEvent e) {
|
||||
return e.getData(PlatformDataKeys.PROJECT);
|
||||
}
|
||||
|
||||
private static VirtualFile[] getFiles(AnActionEvent e) {
|
||||
return e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY);
|
||||
}
|
||||
|
||||
+1
-1
@@ -429,7 +429,7 @@ public class XLineBreakpointImpl<P extends XBreakpointProperties> extends XBreak
|
||||
}
|
||||
|
||||
public void actionPerformed(final AnActionEvent e) {
|
||||
XDebuggerUtil.getInstance().removeBreakpoint(getProject(), XLineBreakpointImpl.this);
|
||||
XDebuggerUtil.getInstance().removeBreakpoint(XLineBreakpointImpl.this.getProject(), XLineBreakpointImpl.this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-5
@@ -80,11 +80,6 @@ public class AssociationsGroup extends ActionGroup {
|
||||
return XsltSupport.isXsltFile(psiFile);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static Project getProject(@Nullable AnActionEvent e) {
|
||||
return e != null ? LangDataKeys.PROJECT.getData(e.getDataContext()) : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static PsiFile getPsiFile(@Nullable AnActionEvent e) {
|
||||
return e != null ? LangDataKeys.PSI_FILE.getData(e.getDataContext()) : null;
|
||||
|
||||
Reference in New Issue
Block a user