public final class Platform extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(String type,
EventListener listener)
Add a platform event listener.
|
CompletionStage<Platform> |
applySnapshot(PlatformSnapshot snapshot,
PlatformSnapshotOptions opts)
Adds a snapshot to a running Platform.
|
CompletionStage<Platform> |
applySnapshot(String requestedSnapshot,
PlatformSnapshotOptions opts)
Adds a snapshot to a running Platform.
|
CompletionStage<Void> |
closeView(PlatformView view)
Closes a specified view in a target window.
|
CompletionStage<PlatformView> |
createView(PlatformViewOptions viewOpts,
Identity target)
Creates a new view and attaches it to a specified target window.
|
CompletionStage<Window> |
createWindow(WindowOptions winOpts)
Creates a new Window.
|
CompletionStage<ChannelClient> |
getChannelClient() |
CompletionStage<PlatformSnapshot> |
getSnapshot()
Returns a snapshot of the platform in its current state.
|
String |
getUuid()
Get UUID of this platform object.
|
CompletionStage<Void> |
quit()
Closes current platform, all its windows, and their views.
|
void |
removeEventListener(String type,
EventListener listener)
Remove the platform event listener
|
CompletionStage<PlatformView> |
reparentView(Identity viewIdentity,
Identity targetIdentity)
Reparents a specified view in a new target window.
|
static CompletionStage<Platform> |
start(DesktopConnection desktopConnection,
PlatformOptions platformOptions)
Deprecated.
use launchManifest() instead.
|
static CompletionStage<Platform> |
startFromManifest(DesktopConnection desktopConnection,
String manifestUrl)
Retrieves platforms's manifest and returns a wrapped and running Platform.
|
static Platform |
wrap(String uuid,
DesktopConnection desktopConnection)
Synchronously returns a Platform object that represents an existing platform.
|
public static CompletionStage<Platform> start(DesktopConnection desktopConnection, PlatformOptions platformOptions)
desktopConnection - Connection object to the AppDesktop.platformOptions - The required options object, also any Application option is also a valid platform option.public static CompletionStage<Platform> startFromManifest(DesktopConnection desktopConnection, String manifestUrl)
desktopConnection - Connection object to the AppDesktop.manifestUrl - The URL of platform's manifest.public String getUuid()
public void addEventListener(String type, EventListener listener)
type - event namelistener - event listener to be addedpublic void removeEventListener(String type, EventListener listener)
type - event namelistener - event listener to be removed.public CompletionStage<Platform> applySnapshot(String requestedSnapshot, PlatformSnapshotOptions opts)
requestedSnapshot - Url or filepath to a snapshot JSON object.opts - Optional parameters to specify whether existing windows should be closed.public CompletionStage<Platform> applySnapshot(PlatformSnapshot snapshot, PlatformSnapshotOptions opts)
snapshot - snapshot object.opts - Optional parameters to specify whether existing windows should be closed.public CompletionStage<Void> closeView(PlatformView view)
view - the view to be closed.public CompletionStage<PlatformView> createView(PlatformViewOptions viewOpts, Identity target)
viewOpts - View creation optionstarget - The window to which the new view is to be attached. If no target, create a view in a new window.public CompletionStage<Window> createWindow(WindowOptions winOpts)
winOpts - Window creation optionspublic CompletionStage<PlatformSnapshot> getSnapshot()
public CompletionStage<PlatformView> reparentView(Identity viewIdentity, Identity targetIdentity)
viewIdentity - View identitytargetIdentity - New owner window identitypublic CompletionStage<Void> quit()
public static Platform wrap(String uuid, DesktopConnection desktopConnection)
uuid - UUID of the platform.desktopConnection - Connection object to the AppDesktop.public CompletionStage<ChannelClient> getChannelClient()
Copyright © 2022. All rights reserved.