mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -20,7 +20,6 @@ import com.intellij.openapi.actionSystem.ex.AnActionListener;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.components.ApplicationComponent;
|
||||
import com.intellij.openapi.extensions.PluginId;
|
||||
import com.intellij.openapi.project.ProjectType;
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -89,20 +88,6 @@ public abstract class ActionManager implements ApplicationComponent {
|
||||
*/
|
||||
public abstract AnAction getAction(@NonNls @NotNull String actionId);
|
||||
|
||||
/**
|
||||
* Returns action associated with the specified actionId.
|
||||
*
|
||||
* @param actionId Id of the registered action
|
||||
*
|
||||
* @return Action associated with the specified actionId, <code>null</code> if
|
||||
* there is no actions associated with the specified actionId
|
||||
*
|
||||
* @exception java.lang.IllegalArgumentException if <code>actionId</code> is <code>null</code>
|
||||
*
|
||||
* @see com.intellij.openapi.actionSystem.IdeActions
|
||||
*/
|
||||
public abstract AnAction getAction(@NonNls @NotNull String actionId, @Nullable ProjectType projectType);
|
||||
|
||||
/**
|
||||
* Returns actionId associated with the specified action.
|
||||
*
|
||||
|
||||
+8
-24
@@ -486,28 +486,12 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
|
||||
|
||||
@Override
|
||||
public AnAction getAction(@NotNull String id) {
|
||||
return getActionImpl(id, false, null);
|
||||
return getActionImpl(id, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnAction getAction(@NonNls @NotNull String actionId, @Nullable ProjectType projectType) {
|
||||
return getActionImpl(actionId, false, projectType);
|
||||
}
|
||||
|
||||
private AnAction getActionImpl(String id, boolean canReturnStub, ProjectType projectType) {
|
||||
private AnAction getActionImpl(String id, boolean canReturnStub) {
|
||||
synchronized (myLock) {
|
||||
AnAction action;
|
||||
Object o = myId2Action.get(id);
|
||||
if (o == null) {
|
||||
return null;
|
||||
}
|
||||
if (o instanceof AnAction) {
|
||||
action = (AnAction)o;
|
||||
}
|
||||
else {
|
||||
//noinspection unchecked
|
||||
action = ((Map<ProjectType, AnAction>)o).get(projectType);
|
||||
}
|
||||
AnAction action = myId2Action.get(id);
|
||||
if (!canReturnStub && action instanceof ActionStub) {
|
||||
action = convert((ActionStub)action);
|
||||
}
|
||||
@@ -558,7 +542,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
|
||||
|
||||
@Override
|
||||
public boolean isGroup(@NotNull String actionId) {
|
||||
return getActionImpl(actionId, true, null) instanceof ActionGroup;
|
||||
return getActionImpl(actionId, true) instanceof ActionGroup;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -568,7 +552,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
|
||||
|
||||
@Override
|
||||
public AnAction getActionOrStub(String id) {
|
||||
return getActionImpl(id, true, null);
|
||||
return getActionImpl(id, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -863,10 +847,10 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
|
||||
reportActionError(pluginId, actionName + ": attribute \"group-id\" should be defined");
|
||||
return null;
|
||||
}
|
||||
AnAction parentGroup = getActionImpl(groupId, true, null);
|
||||
AnAction parentGroup = getActionImpl(groupId, true);
|
||||
if (parentGroup == null) {
|
||||
reportActionError(pluginId, actionName + ": group with id \"" + groupId + "\" isn't registered; action will be added to the \"Other\" group");
|
||||
parentGroup = getActionImpl(IdeActions.GROUP_OTHER_MENU, true, null);
|
||||
parentGroup = getActionImpl(IdeActions.GROUP_OTHER_MENU, true);
|
||||
}
|
||||
if (!(parentGroup instanceof DefaultActionGroup)) {
|
||||
reportActionError(pluginId, actionName + ": group with id \"" + groupId + "\" should be instance of " + DefaultActionGroup.class.getName() +
|
||||
@@ -963,7 +947,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
|
||||
return null;
|
||||
}
|
||||
|
||||
AnAction action = getActionImpl(ref, true, null);
|
||||
AnAction action = getActionImpl(ref, true);
|
||||
|
||||
if (action == null) {
|
||||
if (!myNotRegisteredInternalActionIds.contains(ref)) {
|
||||
|
||||
Reference in New Issue
Block a user