Class JavaJsBridge
- java.lang.Object
- 
- com.inductiveautomation.perspective.designer.workspace.JavaJsBridge
 
- 
- Direct Known Subclasses:
- SessionPropsAdapter.SessionAdapterBridge,- ViewEditorJsBridge
 
 public abstract class JavaJsBridge extends java.lang.ObjectThis class acts as a 'bridge' between the Java and Javascript environments. It is instantiated and embedded into the js environment through JxBrowser's Java accessibility API. Calls which are made FROM javascript are annotated withJsAccessible.- Since:
- 8.0.0
 
- 
- 
Constructor SummaryConstructors Constructor Description JavaJsBridge(com.teamdev.jxbrowser.browser.Browser browser)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactivateComponentTool(java.lang.String componentType)voidactivateComponentTool(java.lang.String componentType, java.lang.String variantId)voidaddComponents(java.util.List<ComponentConfig> componentConfigs, java.awt.Point point)Add components to the current deeply selected container, specifying the locationvoidaddComponents(java.util.List<ComponentConfig> componentConfigs, java.awt.Rectangle location)Add components to the current deeply selected container, specifying location and sizevoidaddComponentsToContainer(java.lang.String parentIndexPath, java.util.List<ComponentConfig> componentConfigs, java.awt.Rectangle location, int[] childrenIndexes)Add components to a specific container, even if it isn't deeply selected.voidalignSelectedComponents(CoordinateContainerDesignDelegate.AlignType type, java.lang.Integer padding)voidalterEventConfig(EventConfigChange change)voidalterPropertyConfig(PropertyConfigChange change, boolean createUndoAction)voidalterScriptConfig(ScriptConfigChange change)abstract voidalterViewPermissions(PermissionsConfig permissionsConfig)voidcopyJsonToClipboard()java.util.concurrent.CompletableFuture<JxValue>copySelectedPipe()java.util.concurrent.CompletableFuture<JxValue>copySelection()voidcutJsonToClipboard()voiddeleteComponents(java.lang.String[] indexPaths)Deletes the components at the given index pathsvoiddeleteSelected()Deletes the components currently selected in the designer store.voiddeleteSelectedPipeConnection()Deletes the selected PipevoiddeleteSelectedPipes()Deletes the selected PipevoiddisableEditorEvents()voidenableEditorEvents()voidflattenSelectedSvg()voidflattenSvg(java.lang.String svg, java.lang.String position, java.lang.String name)protected abstract java.lang.StringgetBridgeDesc()java.lang.StringgetChildPositionDefaults(java.lang.String componentType, boolean forInit)java.lang.StringgetComponentBaseName(java.lang.String componentType)java.util.concurrent.CompletableFuture<ComponentDetails>getComponentDetails(java.lang.String componentIndexPath)protected abstract DesignerContextgetContextInternal()java.util.concurrent.CompletableFuture<java.lang.String>getEffectivePipeSelectionAppearance()<T> java.util.concurrent.CompletableFuture<T>getForSave(java.util.function.BiFunction<java.lang.String,com.inductiveautomation.ignition.common.gson.Gson,T> parse)Retrieves the view config from the running View instance in the DesignerViewInstanceStore.java.lang.StringgetInitMsg()Gets the info needed to open a new view for editing.java.lang.StringgetOwnViewConfig()Gets the current view configuration from the Designer Project.java.lang.StringgetOwnViewPath()Called to get the current name of the project resource associated with a view's tabId.java.lang.StringgetPropertyDefaults(java.lang.String propertyType, java.lang.String componentType, java.lang.String variantId, boolean forInit)Returns a json object containing the default properties registered in the component registry.java.lang.StringgetSessionProps()protected abstract SessionPropsConfiggetSessionPropsInternal()java.lang.StringgetStyles()java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>>getSymbolicPath(java.lang.String indexPath)java.lang.StringgetViewConfig(java.lang.String resourcePath)protected abstract ViewConfiggetViewConfigInternal()protected abstract ViewConfiggetViewConfigInternal(java.lang.String resourcePath)protected abstract java.lang.StringgetViewPathInternal()abstract java.util.concurrent.CompletableFuture<PermissionsConfig>getViewPermissions()voidinsertProperty(InsertPropertyChange change)protected java.util.concurrent.CompletableFuture<JxValue>invokeStoreFunction(java.lang.String functionName, java.lang.Object... args)Invokes a method on the DesignerStore.tsx object.voidnotifyViewUpdated(java.lang.String path)voidonBindingPreviewValue(java.lang.String serializedMessage)Called from a DesignerStore handler upon receiving the 'binding-edit-value-update' message.protected abstract voidonBindingPreviewValueInternal(BindingEditValueUpdate update)voidonContextMenu(java.lang.String pointJson, boolean isSvg, boolean isView)protected abstract voidonContextMenuInternal(java.awt.Point point, boolean isSvg, boolean isView)voidonDeepSelectionChange(java.lang.String json)protected abstract voidonDeepSelectionChangeInternal(DeepSelection deepSelection, com.teamdev.jxbrowser.js.JsObject storeObject)voidonDeepSelectionPropsUpdated(java.lang.String json)protected abstract voidonDeepSelectionPropsUpdatedInternal(DeepSelectionUpdateEvent event)voidonErrorMessage(java.lang.String message)voidonImageDropped(java.lang.String imageSource, java.lang.String dropPoint)voidonPipeModeChange(java.lang.String pipeMode)Called when the pipe mode changes.protected abstract voidonPipeModeChangeInternal(java.lang.String pipeMode)voidonPipeSelectionChange(java.lang.String pipeSelection, boolean replaceComponentSelection)Called when the pipe selection changes.protected abstract voidonPipeSelectionChangeInternal(java.util.List<PipeSelectionDetail> details, boolean replaceComponentSelection)voidonSaveComplete(java.lang.String json)Called from a DesignerStore once the data to save has been gathered via PromisevoidonSaveError(java.lang.String reason)Called from a DesignerStore if there was an error gathering the data to savevoidonSelectionChange(java.lang.String rootViewPath, java.lang.String detailsJson)Called when the selection changes.protected abstract voidonSelectionChangeInternal(java.lang.String rootViewPath, java.util.List<ComponentDetails> details)voidonSelectionConfigUpdated(java.lang.String changesJson)Called when one of the currently selected components config changes (bindings or event config)protected abstract voidonSelectionConfigUpdatedInternal(java.util.List<ComponentDetails> changes)voidonSelectionPropertyChange(java.lang.String rootViewPath, java.lang.String changesJson)Called when one of the currently selected components' properties changesprotected abstract voidonSelectionPropertyChangeInternal(SelectionPropertyUpdateEvent event)voidonStructureChange(java.lang.String structureJson)protected abstract voidonStructureChangeInternal(ViewStructure structure)voidonSvgDropped(java.lang.String name, java.lang.String svgSource, java.lang.String dropPoint)voidonTagsDropped(java.lang.String path, java.lang.String tagsJson, java.lang.String dropPointJson, java.lang.String modifiers)voidonUndoableAction(java.lang.String key, java.lang.String json)voidpasteJsonFromClipboard()voidpastePipes(java.util.List<PipeConfig> pipe, java.awt.Point point)Add pipes to the current deeply selected containervoidremoveChildPropertyConfigs(java.lang.String componentIndexPath, PropertyType scope, java.lang.String propertyPath)voidremoveProperty(RemovePropertyChange change, boolean createUndoAction)voidrenameProperty(RenamePropertyChange change, boolean createUndoAction)voidreorderSelectedComponents(ViewWorkspaceActions.ReorderType type)voidreplaceComponent(java.lang.String path, ComponentConfig component)Replaces the component at the specified path with the specified ComponentConfig.java.util.concurrent.CompletableFuture<JxValue>sendRaw(java.lang.String protocol, java.lang.String payloadJson)Sends a message through the websocket held by the connection store.voidsetChildrenIndexes(ChildrenIndexesChange change)voidsetDeepSelection(java.lang.String path)voidsetPipeMode(java.lang.String pipeMode)PipingvoidsetPipeSelection(java.util.List<PipeSelectionDetail> details)voidsetPreview(boolean preview)voidsetSelection(java.util.List<java.lang.String> selection)voidstylesUpdated(java.lang.String styles)voidwrapComponent(java.lang.String path, ViewWorkspaceActions.WrapInType type)Wraps a component at the specified Path with a specified Type of component.voidwriteProperties(WritePropertiesChange change)voidwriteProperty(WritePropertyChange change, boolean createUndoAction)
 
- 
- 
- 
Field Detail- 
logprotected final LoggerEx log 
 - 
gsonprotected final com.inductiveautomation.ignition.common.gson.Gson gson 
 
- 
 - 
Method Detail- 
getBridgeDescprotected abstract java.lang.String getBridgeDesc() 
 - 
getForSavepublic <T> java.util.concurrent.CompletableFuture<T> getForSave(java.util.function.BiFunction<java.lang.String,com.inductiveautomation.ignition.common.gson.Gson,T> parse) Retrieves the view config from the running View instance in the DesignerViewInstanceStore.
 - 
onSaveCompletepublic void onSaveComplete(java.lang.String json) Called from a DesignerStore once the data to save has been gathered via Promise- Parameters:
- json- JSON stringified view data or session props data
 
 - 
onSaveErrorpublic void onSaveError(java.lang.String reason) Called from a DesignerStore if there was an error gathering the data to save- Parameters:
- reason- the reason why there was an error
 
 - 
getOwnViewPathpublic java.lang.String getOwnViewPath() Called to get the current name of the project resource associated with a view's tabId. Derives from the designer project.- Returns:
- string representation of this View's path in the project resource.
 
 - 
getViewPathInternalprotected abstract java.lang.String getViewPathInternal() 
 - 
getOwnViewConfigpublic java.lang.String getOwnViewConfig() Gets the current view configuration from the Designer Project. Used as the view definition in the designer's instance store.- Returns:
- the view config from the designer as a ViewConfig
 
 - 
getViewConfigInternalprotected abstract ViewConfig getViewConfigInternal() 
 - 
getContextInternalprotected abstract DesignerContext getContextInternal() 
 - 
getSessionPropspublic java.lang.String getSessionProps() 
 - 
getSessionPropsInternalprotected abstract SessionPropsConfig getSessionPropsInternal() 
 - 
getInitMsgpublic java.lang.String getInitMsg() Gets the info needed to open a new view for editing.
 - 
getPropertyDefaultspublic java.lang.String getPropertyDefaults(java.lang.String propertyType, java.lang.String componentType, java.lang.String variantId, boolean forInit)Returns a json object containing the default properties registered in the component registry. If forInit is true, default props will include example values when found in the registered component descriptors example props.
 - 
getChildPositionDefaultspublic java.lang.String getChildPositionDefaults(java.lang.String componentType, boolean forInit)
 - 
getComponentBaseNamepublic java.lang.String getComponentBaseName(java.lang.String componentType) 
 - 
onStructureChangepublic void onStructureChange(java.lang.String structureJson) 
 - 
onStructureChangeInternalprotected abstract void onStructureChangeInternal(ViewStructure structure) 
 - 
activateComponentToolpublic void activateComponentTool(java.lang.String componentType) 
 - 
activateComponentToolpublic void activateComponentTool(java.lang.String componentType, java.lang.String variantId)
 - 
invokeStoreFunctionprotected java.util.concurrent.CompletableFuture<JxValue> invokeStoreFunction(java.lang.String functionName, java.lang.Object... args) Invokes a method on the DesignerStore.tsx object.
 - 
notifyViewUpdatedpublic void notifyViewUpdated(java.lang.String path) 
 - 
sendRawpublic java.util.concurrent.CompletableFuture<JxValue> sendRaw(java.lang.String protocol, java.lang.String payloadJson) Sends a message through the websocket held by the connection store.
 - 
getComponentDetailspublic java.util.concurrent.CompletableFuture<ComponentDetails> getComponentDetails(java.lang.String componentIndexPath) 
 - 
getEffectivePipeSelectionAppearancepublic java.util.concurrent.CompletableFuture<java.lang.String> getEffectivePipeSelectionAppearance() 
 - 
setChildrenIndexespublic void setChildrenIndexes(ChildrenIndexesChange change) 
 - 
writePropertypublic void writeProperty(WritePropertyChange change, boolean createUndoAction) 
 - 
writePropertiespublic void writeProperties(WritePropertiesChange change) 
 - 
insertPropertypublic void insertProperty(InsertPropertyChange change) 
 - 
renamePropertypublic void renameProperty(RenamePropertyChange change, boolean createUndoAction) 
 - 
removePropertypublic void removeProperty(RemovePropertyChange change, boolean createUndoAction) 
 - 
alterPropertyConfigpublic void alterPropertyConfig(PropertyConfigChange change, boolean createUndoAction) 
 - 
alterEventConfigpublic void alterEventConfig(EventConfigChange change) 
 - 
alterScriptConfigpublic void alterScriptConfig(ScriptConfigChange change) 
 - 
removeChildPropertyConfigspublic void removeChildPropertyConfigs(java.lang.String componentIndexPath, PropertyType scope, java.lang.String propertyPath)
 - 
alterViewPermissionspublic abstract void alterViewPermissions(PermissionsConfig permissionsConfig) 
 - 
getViewPermissionspublic abstract java.util.concurrent.CompletableFuture<PermissionsConfig> getViewPermissions() 
 - 
onBindingPreviewValuepublic void onBindingPreviewValue(java.lang.String serializedMessage) Called from a DesignerStore handler upon receiving the 'binding-edit-value-update' message.- Parameters:
- serializedMessage- Base64 serialized object from the gateway
 
 - 
onBindingPreviewValueInternalprotected abstract void onBindingPreviewValueInternal(BindingEditValueUpdate update) 
 - 
onDeepSelectionChangepublic void onDeepSelectionChange(java.lang.String json) 
 - 
onDeepSelectionChangeInternalprotected abstract void onDeepSelectionChangeInternal(DeepSelection deepSelection, com.teamdev.jxbrowser.js.JsObject storeObject) 
 - 
onDeepSelectionPropsUpdatedpublic void onDeepSelectionPropsUpdated(java.lang.String json) 
 - 
onDeepSelectionPropsUpdatedInternalprotected abstract void onDeepSelectionPropsUpdatedInternal(DeepSelectionUpdateEvent event) 
 - 
onSelectionChangepublic void onSelectionChange(java.lang.String rootViewPath, java.lang.String detailsJson)Called when the selection changes.- Parameters:
- detailsJson- List<ComponentDetails> encoded in JSON
 
 - 
onSelectionChangeInternalprotected abstract void onSelectionChangeInternal(java.lang.String rootViewPath, java.util.List<ComponentDetails> details)
 - 
onSelectionPropertyChangepublic void onSelectionPropertyChange(java.lang.String rootViewPath, java.lang.String changesJson)Called when one of the currently selected components' properties changes
 - 
onSelectionPropertyChangeInternalprotected abstract void onSelectionPropertyChangeInternal(SelectionPropertyUpdateEvent event) 
 - 
onSelectionConfigUpdatedpublic void onSelectionConfigUpdated(java.lang.String changesJson) Called when one of the currently selected components config changes (bindings or event config)
 - 
onSelectionConfigUpdatedInternalprotected abstract void onSelectionConfigUpdatedInternal(java.util.List<ComponentDetails> changes) 
 - 
onContextMenupublic void onContextMenu(java.lang.String pointJson, boolean isSvg, boolean isView)
 - 
onContextMenuInternalprotected abstract void onContextMenuInternal(java.awt.Point point, boolean isSvg, boolean isView)
 - 
onImageDroppedpublic void onImageDropped(java.lang.String imageSource, java.lang.String dropPoint)
 - 
onSvgDroppedpublic void onSvgDropped(java.lang.String name, java.lang.String svgSource, java.lang.String dropPoint)
 - 
onTagsDroppedpublic void onTagsDropped(java.lang.String path, java.lang.String tagsJson, java.lang.String dropPointJson, java.lang.String modifiers)
 - 
onUndoableActionpublic void onUndoableAction(java.lang.String key, java.lang.String json)
 - 
onErrorMessagepublic void onErrorMessage(java.lang.String message) 
 - 
flattenSvgpublic void flattenSvg(java.lang.String svg, java.lang.String position, java.lang.String name)
 - 
setSelectionpublic void setSelection(java.util.List<java.lang.String> selection) 
 - 
setDeepSelectionpublic void setDeepSelection(java.lang.String path) 
 - 
deleteSelectedpublic void deleteSelected() Deletes the components currently selected in the designer store.
 - 
deleteComponentspublic void deleteComponents(java.lang.String[] indexPaths) Deletes the components at the given index paths
 - 
flattenSelectedSvgpublic void flattenSelectedSvg() 
 - 
alignSelectedComponentspublic void alignSelectedComponents(CoordinateContainerDesignDelegate.AlignType type, java.lang.Integer padding) 
 - 
reorderSelectedComponentspublic void reorderSelectedComponents(ViewWorkspaceActions.ReorderType type) 
 - 
replaceComponentpublic void replaceComponent(java.lang.String path, ComponentConfig component)Replaces the component at the specified path with the specified ComponentConfig. Used to make undo-redo easy for wrapComponent.- Parameters:
- path- The addressPathString of the Component to be replaced.
- component- The componentConfig to replace the Component with
 
 - 
wrapComponentpublic void wrapComponent(java.lang.String path, ViewWorkspaceActions.WrapInType type)Wraps a component at the specified Path with a specified Type of component. WrapInType is not a component id, nor is there a 1:1 between the two. For example: Flex Containers have both flex_row, and flex_column.- Parameters:
- path- The addressPathString of the Component to be wrapped. If null, the currently selected Component will be wrapped.
- type- The WrapInType to use to determine the strategy used for wrapping the Component.
 
 - 
addComponentsToContainerpublic void addComponentsToContainer(java.lang.String parentIndexPath, java.util.List<ComponentConfig> componentConfigs, @Nullable java.awt.Rectangle location, @Nullable int[] childrenIndexes)Add components to a specific container, even if it isn't deeply selected.
 - 
addComponentspublic void addComponents(java.util.List<ComponentConfig> componentConfigs, @Nullable java.awt.Point point) Add components to the current deeply selected container, specifying the location
 - 
addComponentspublic void addComponents(java.util.List<ComponentConfig> componentConfigs, java.awt.Rectangle location) Add components to the current deeply selected container, specifying location and size
 - 
copySelectionpublic java.util.concurrent.CompletableFuture<JxValue> copySelection() 
 - 
disableEditorEventspublic void disableEditorEvents() 
 - 
enableEditorEventspublic void enableEditorEvents() 
 - 
copyJsonToClipboardpublic void copyJsonToClipboard() 
 - 
pasteJsonFromClipboardpublic void pasteJsonFromClipboard() 
 - 
cutJsonToClipboardpublic void cutJsonToClipboard() 
 - 
getViewConfigpublic java.lang.String getViewConfig(java.lang.String resourcePath) - Returns:
- a ViewConfig's json string equivalent for a view found at the given path.
 
 - 
getViewConfigInternalprotected abstract ViewConfig getViewConfigInternal(java.lang.String resourcePath) 
 - 
setPreviewpublic void setPreview(boolean preview) 
 - 
getSymbolicPathpublic java.util.concurrent.CompletableFuture<java.util.List<java.lang.String>> getSymbolicPath(java.lang.String indexPath) 
 - 
stylesUpdatedpublic void stylesUpdated(java.lang.String styles) 
 - 
getStylespublic java.lang.String getStyles() 
 - 
setPipeModepublic void setPipeMode(java.lang.String pipeMode) Piping
 - 
onPipeModeChangepublic void onPipeModeChange(java.lang.String pipeMode) Called when the pipe mode changes.
 - 
onPipeModeChangeInternalprotected abstract void onPipeModeChangeInternal(java.lang.String pipeMode) 
 - 
setPipeSelectionpublic void setPipeSelection(java.util.List<PipeSelectionDetail> details) 
 - 
onPipeSelectionChangepublic void onPipeSelectionChange(java.lang.String pipeSelection, boolean replaceComponentSelection)Called when the pipe selection changes.
 - 
onPipeSelectionChangeInternalprotected abstract void onPipeSelectionChangeInternal(java.util.List<PipeSelectionDetail> details, boolean replaceComponentSelection) 
 - 
copySelectedPipepublic java.util.concurrent.CompletableFuture<JxValue> copySelectedPipe() 
 - 
pastePipespublic void pastePipes(java.util.List<PipeConfig> pipe, @Nullable java.awt.Point point) Add pipes to the current deeply selected container
 - 
deleteSelectedPipespublic void deleteSelectedPipes() Deletes the selected Pipe
 - 
deleteSelectedPipeConnectionpublic void deleteSelectedPipeConnection() Deletes the selected Pipe
 
- 
 
-