VisualAction

interface VisualAction<T : ActionAbility<*>> : Action<T>

需要显示界面的 Action.

Author

M8Test, [email protected], https://m8test.com

Inheritors

Types

Link copied to clipboard
sealed class Location

VisualAction 显示的位置, 例如对话框, 悬浮窗等.

Functions

Link copied to clipboard
abstract fun getDescription(): String

获取描述信息, 表明 Action 的作用

Link copied to clipboard
abstract fun getIconId(): Int

获取显示的图标id.

Link copied to clipboard
abstract fun getId(): String

获取动作唯一标识, ActionGroup 中不能包含多个相同 id 的 Action.

Link copied to clipboard

获取动作显示的位置.

Link copied to clipboard
abstract fun getName(): String

获取动作名称.

Link copied to clipboard
abstract fun getResources(): Resources

获取 getIconId 所属的 Resources 对象.

Link copied to clipboard
abstract fun isEnabled(ability: T): Boolean

判断当前动作是否可用.

Link copied to clipboard
abstract fun isVisible(ability: T): Boolean

判断当前动作是否可见.

Link copied to clipboard
abstract fun setEnabled(enabled: Boolean)

设置动作是否可用.

Link copied to clipboard
abstract fun setVisible(visible: Boolean)

设置动作是否可见.

Link copied to clipboard
abstract fun updateEnabledWhen(channel: Channel, predicate: (Event) -> Boolean)

什么时候重新执行 isEnabled.

Link copied to clipboard
abstract fun updateVisibleWhen(channel: Channel, predicate: (Event) -> Boolean)

什么时候重新执行 isVisible.