Skip to content

KeyResolver

final class KeyResolver
Package: dev.joid.lib.input.key.resolver · Module: core · Source: KeyResolver.java

The registry of the key resolvers that turn the bindings of your application into keys for shortcuts.

A Shortcut created from an object that is not a Key asks this registry which key it stands for. In dev mode, a shortcut whose binding no resolver knows prints a warning when it is created, and fires once a resolver that knows it is registered.

ReturnsSignatureSummary
voidregister(IKeyResolver resolver) staticAdds a resolver, asked before every resolver registered earlier.
voidunregister(IKeyResolver resolver) staticRemoves a resolver; the shortcuts whose binding only it knew stop firing.
booleansupports(Object binding) staticIf true, the binding is a Key or when a registered resolver supports it.
Keyresolve(Object binding) staticReturns the key of a binding: a Key as it is, any other object through the first resolver that supports it.

void register(IKeyResolver resolver) static

Adds a resolver, asked before every resolver registered earlier. Registering the same resolver again moves it to the front.

void unregister(IKeyResolver resolver) static

Removes a resolver; the shortcuts whose binding only it knew stop firing.

boolean supports(Object binding) static

If true, the binding is a Key or when a registered resolver supports it.

Key resolve(Object binding) static

Throws:

  • IllegalArgumentException: No key resolver knows the binding … of type …, pass a Key or register an IKeyResolver with KeyResolver.register(…)

Returns the key of a binding: a Key as it is, any other object through the first resolver that supports it. Throws an IllegalArgumentException when no resolver supports the binding.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page