Class URLProtocolHandler
java.lang.Object
gaiasky.util.urlprotocol.URLProtocolHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<String, ActionHandler> static final StringThe URL scheme handled by this class. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringReturns and clears the pending URL, if any.static voidhandle(String url, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) Handles the given URL with the default behavior (no hot-load).static voidhandle(String url, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, boolean hotLoad) Handles the given URL, if it has not been handled yet.static booleanisDatasetUrl(String arg) Returns true if the given CLI argument is aURLProtocolHandlerURL.static voidsetPendingUrl(String url) Stores a URL received before the UI is ready (e.g.
-
Field Details
-
URL_SCHEME
-
ACTIONS
-
-
Method Details
-
isDatasetUrl
Returns true if the given CLI argument is aURLProtocolHandlerURL.- Parameters:
arg- The CLI argument.- Returns:
- True if the argument is a
gaiasky://URL.
-
setPendingUrl
Stores a URL received before the UI is ready (e.g. through the macOS open-URL event). It will be processed by the startup path once the welcome GUI is built.- Parameters:
url- The dataset URL.
-
consumePendingUrl
Returns and clears the pending URL, if any.- Returns:
- The pending dataset URL, or null if none is set.
-
handle
public static void handle(String url, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) Handles the given URL with the default behavior (no hot-load). Seehandle(String, Skin, Stage, boolean).- Parameters:
url- The URL, as received in the CLI.skin- The UI skin.stage- The UI stage.
-
handle
public static void handle(String url, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, boolean hotLoad) Handles the given URL, if it has not been handled yet. This must be called from the GL thread, once a UI stage is available and the dataset metadata has been fetched.If
hotLoadis false (startup path), an already-installed dataset is only enabled — it will be loaded by the regular startup sequence. IfhotLoadis true (Gaia Sky already running), the dataset is loaded immediately after installation/enabling through the hot-load API.The deduplication guard only applies to the startup path (
hotLoadis false), where the same CLI URL may be processed more than once (e.g. when the welcome GUI is rebuilt). URLs forwarded from a second instance (hotLoadis true) are always processed, so that re-sending the same URL works as expected.- Parameters:
url- The URL, as received in the CLI.skin- The UI skin.stage- The UI stage.hotLoad- True to hot-load the dataset once installed/enabled.
-