Verified Owner
Top Description Fields Methods
org.jabref.logic

public Interface UiMessageHandler

Imports
java.util.List

Specifies an interface that can process either cli or remote commands to the ui

See org.jabref.logic.remote.server.RemoteMessageHandler

Field Summary

Modifier and TypeField and Description
public static final UiMessageHandler
NONE

Null object bound by the standalone HTTP server, which runs without a GUI.

Method Summary

Modifier and TypeMethod and Description
public void
public default boolean
isGuiConnected()

Whether a GUI is connected.

Field Detail

NONEback to summary
public static final UiMessageHandler NONE

Null object bound by the standalone HTTP server, which runs without a GUI.

The REST resources declare a mandatory @Inject UiMessageHandler, so something has to be bound in the HK2 service locator — otherwise HK2 fails to construct the resource (HTTP 500) before the resource's own "GUI required" check can run. Standalone mode therefore binds this null object instead of a real handler; resources detect it via isGuiConnected() and reply with a clear 400 "Only possible in GUI mode." instead of a dependency-injection failure.

Calling handleUiCommands on it means the GUI check was skipped (a programming error), so it fails fast rather than silently swallowing the command.

Method Detail

handleUiCommandsback to summary
public void handleUiCommands(List<UiCommand> uiCommands)
isGuiConnectedback to summary
public default boolean isGuiConnected()

Whether a GUI is connected. false only for the NONE null object used by the standalone server; any real handler returns true.