mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[completion] IJPL-207762 allow ActionRemoteBehaviorSpecification to default to null behavior
GitOrigin-RevId: 3f6c460ab7f327779ec057b2352d0c0430502a71
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d098eb720d
commit
323a3bbf72
+1
-1
@@ -69,7 +69,7 @@ enum class ActionRemoteBehavior {
|
||||
@ApiStatus.Internal
|
||||
@ApiStatus.Experimental
|
||||
interface ActionRemoteBehaviorSpecification {
|
||||
fun getBehavior(): ActionRemoteBehavior
|
||||
fun getBehavior(): ActionRemoteBehavior?
|
||||
|
||||
interface Frontend : ActionRemoteBehaviorSpecification {
|
||||
override fun getBehavior(): ActionRemoteBehavior = ActionRemoteBehavior.FrontendOnly
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ private fun ActionRuntimeRegistrar.replaceExistingAction(
|
||||
}
|
||||
|
||||
private fun hideActionOnWelcomeScreen(action: AnAction): AnAction {
|
||||
return if (action is ActionRemoteBehaviorSpecification) {
|
||||
return if (action is ActionRemoteBehaviorSpecification && action.getBehavior() != null) {
|
||||
WelcomeScreenHiddenActionWithRemoteSpec(action)
|
||||
}
|
||||
else {
|
||||
@@ -51,7 +51,7 @@ private fun hideActionOnWelcomeScreen(action: AnAction): AnAction {
|
||||
private class WelcomeScreenHiddenActionWithRemoteSpec<T>(val actionWithSpec: T) : WelcomeScreenHiddenAction(actionWithSpec),
|
||||
ActionRemoteBehaviorSpecification
|
||||
where T : AnAction, T : ActionRemoteBehaviorSpecification {
|
||||
override fun getBehavior(): ActionRemoteBehavior = actionWithSpec.getBehavior()
|
||||
override fun getBehavior(): ActionRemoteBehavior? = actionWithSpec.getBehavior()
|
||||
}
|
||||
|
||||
private open class WelcomeScreenHiddenAction(action: AnAction) : AnActionWrapper(action) {
|
||||
|
||||
Reference in New Issue
Block a user