Class VisionDesignerImpl
java.lang.Object
com.inductiveautomation.ignition.designer.model.AbstractDesignerModuleHook
com.inductiveautomation.factorypmi.designer.model.VisionDesignerImpl
- All Implemented Interfaces:
DesignerModuleHook,VisionClientInterface,VisionDesignerInterface
public class VisionDesignerImpl
extends AbstractDesignerModuleHook
implements VisionDesignerInterface
This is the core of the Vision module, implementing both
DesignerModuleHook and
VisionDesignerInterface. Most of the heavy lifting is actually done in the WindowWorkspace class.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from interface com.inductiveautomation.vision.api.client.VisionClientInterface
VISION_MODULE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddExtensibleBindingType(BindingType binding) Adds a new binding type to be used in the extensible binding systemvoidaddNewTemplate(ResourcePath parentFolder, int width, int height) voidaddNewTemplate(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) voidaddNewTemplate(ResourcePath parentFolder, VisionTemplate template) voidaddNewTemplate(ResourcePath parentFolder, VisionTemplate template, Consumer<ResourcePath> onFinished) voidaddNewWindow(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) Adds a new window to theFPMIAppbeing designedvoidaddNewWindow(ResourcePath parentFolder, FPMIWindow newWindow) voidaddNewWindow(ResourcePath parentFolder, FPMIWindow newWindow, Consumer<ResourcePath> onFinished) Adds a new window to theFHMIAppbeing designedvoidaddWindowDropHandler(WindowDropHandler handler) Add a new drop handler for custom drop types onto windows and templatesvoidaddWindowListener(VisionWindowListener listener) Adds a listener to be notified when windows are opened and closed.cloneComponent(Component comp) booleanconfigureBinding(Component component, String property, BindingConfiguration configuration) Configures a new property binding for the component.property using the given configuration.voidconfigureDeserializer(XMLDeserializer deserializer) voidProvides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this modulecreateNewDockedWindow(int width, int height, int side) getBindingType(String bindingTypeKey) List<com.jidesoft.docking.DockableFrame>A list of DockableFrames that this module provides, that should be available to all workspaces.getGuiUtil(String desktopHandle) Gets the WindowUtilities for a secondary desktop, by handlegetMenu()Returns a menu merge for any global menu additions.List<com.jidesoft.action.CommandBar>Returns the toolbars for the module.Gets the NavUtilities (for the primary desktopgetNavUtil(String desktopHandle) Gets the NavUtilities for a secondary desktop, by handlegetResourceCategoryKey(ProjectResourceId resource) Used by modules that add project resources to an Ignition project.getResourceDisplayName(ProjectResourceId resource) Allows a module to give an appropriate display name for the resource.getResourceIcon(ProjectResourceId resource) Allows a module to give an appropriate icon for a resource.String[]getRoot()Returns the id of the currently selected window folder in the project browser tree.protected voidvoidnewDockedWindow(ResourcePath parentFolder) voidnewDockedWindow(ResourcePath parentFolder, Consumer<ResourcePath> onFinished) voidnewMainWindow(ResourcePath folder) voidnewMainWindow(ResourcePath folder, Consumer<ResourcePath> onFinished) voidnewPopupWindow(ResourcePath parentFolder) voidnewPopupWindow(ResourcePath parentFolder, Consumer<ResourcePath> onFinished) voidnotifyActivationStateChanged(LicenseState licenseState) Notifies this designer module that its license state has changed.voidvoidNotifies the module that the save operation has finished.voidNotifies the module that the user has requested that the project is saved.voidopenBindingDialog(Component component, String propertyName) Opens the binding dialog for a given component.voidvoidremoveWindowDropHandler(WindowDropHandler handler) Removes a drop handler for custom drop types onto windows and templatesvoidremoveWindowListener(VisionWindowListener listiner) Removes window listenerbyte[]Serializes an object to be stored in a ProjectResource.byte[]serializeProjectResource(Object obj, SerializationEncoding encoding) Serializes an object to be stored in a ProjectResource.voidsetContext(DesignerContext context) voidsetWorkspace(WindowWorkspace workspace) voidshutdown()Called when the module is shut down.voidstartup(DesignerContext designerContext, LicenseState activationState) The main entrypoint for the module hook.windowResourceBuilder(FPMIWindow newWindow, boolean openOnStartIfFirst) Methods inherited from class com.inductiveautomation.ignition.designer.model.AbstractDesignerModuleHook
configureFunctionFactory, createPermissionKeys, initializeScriptManager
-
Field Details
-
MODULE_ID
- See Also:
-
-
Constructor Details
-
VisionDesignerImpl
public VisionDesignerImpl()
-
-
Method Details
-
startup
Description copied from interface:DesignerModuleHookThe main entrypoint for the module hook. This will only be called once for a given project. If another project is ever opened,DesignerModuleHook.shutdown()will be called and a new hook will be instantiated- Specified by:
startupin interfaceDesignerModuleHook- Overrides:
startupin classAbstractDesignerModuleHook- Throws:
Exception- if the module was not able to be initialized for the given project.
-
shutdown
public void shutdown()Description copied from interface:DesignerModuleHookCalled when the module is shut down. This will happen if the user opens a different project within the same designer session - the existing modules will be shut down, and new module hooks will be instantiated and started up.- Specified by:
shutdownin interfaceDesignerModuleHook- Overrides:
shutdownin classAbstractDesignerModuleHook
-
addDesignableProjectListener
public void addDesignableProjectListener() -
removeDesignableProjectListener
public void removeDesignableProjectListener() -
addWindowDropHandler
Description copied from interface:VisionDesignerInterfaceAdd a new drop handler for custom drop types onto windows and templates- Specified by:
addWindowDropHandlerin interfaceVisionDesignerInterface
-
removeWindowDropHandler
Description copied from interface:VisionDesignerInterfaceRemoves a drop handler for custom drop types onto windows and templates- Specified by:
removeWindowDropHandlerin interfaceVisionDesignerInterface
-
getWindowDropHandlers
-
getResourceCategoryKey
Description copied from interface:DesignerModuleHookUsed by modules that add project resources to an Ignition project. This will be called when the exporter is displaying all of the resources inside a project for export. Only project resources that match this module's ID will passed to this function.
Used by the import/export system.
- Specified by:
getResourceCategoryKeyin interfaceDesignerModuleHook- Overrides:
getResourceCategoryKeyin classAbstractDesignerModuleHook- Parameters:
resource- A project resource that was added by this module.- Returns:
- A bundle resource key for the category of this resource.
-
getResourceDisplayName
Description copied from interface:DesignerModuleHookAllows a module to give an appropriate display name for the resource. For most resources this won't be necessary (the resource's name itself should be used), but for some resources whose name is null, this may be appropriate.
Used by the import/export system.
- Specified by:
getResourceDisplayNamein interfaceDesignerModuleHook- Overrides:
getResourceDisplayNamein classAbstractDesignerModuleHook- Returns:
- the name for a resource, or null to use the resource's folder path/name.
-
getResourceIcon
Description copied from interface:DesignerModuleHookAllows a module to give an appropriate icon for a resource.
Used by the import/export system.
- Specified by:
getResourceIconin interfaceDesignerModuleHook- Overrides:
getResourceIconin classAbstractDesignerModuleHook
-
getModuleMenu
Description copied from interface:DesignerModuleHookReturns a menu merge for any global menu additions. May be null.- Specified by:
getModuleMenuin interfaceDesignerModuleHook- Overrides:
getModuleMenuin classAbstractDesignerModuleHook- See Also:
-
getMenu
- Returns:
- the
MenuBarMergespecific to the vision workspace
-
getModuleToolbars
Description copied from interface:DesignerModuleHookReturns the toolbars for the module. May be empty but not null.- Specified by:
getModuleToolbarsin interfaceDesignerModuleHook- Overrides:
getModuleToolbarsin classAbstractDesignerModuleHook
-
getFrames
Description copied from interface:DesignerModuleHookA list of DockableFrames that this module provides, that should be available to all workspaces.- Specified by:
getFramesin interfaceDesignerModuleHook- Overrides:
getFramesin classAbstractDesignerModuleHook
-
notifyActivationStateChanged
Description copied from interface:DesignerModuleHookNotifies this designer module that its license state has changed. This could mean that the trial mode has expired (or been reset), the module has been activated, etc.- Specified by:
notifyActivationStateChangedin interfaceDesignerModuleHook- Overrides:
notifyActivationStateChangedin classAbstractDesignerModuleHook
-
addWindowListener
Description copied from interface:VisionClientInterfaceAdds a listener to be notified when windows are opened and closed. Only works during runtime, not designer- Specified by:
addWindowListenerin interfaceVisionClientInterface
-
removeWindowListener
Description copied from interface:VisionClientInterfaceRemoves window listener- Specified by:
removeWindowListenerin interfaceVisionClientInterface
-
configureSerializer
Description copied from interface:DesignerModuleHookProvides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this module- Specified by:
configureSerializerin interfaceDesignerModuleHook- Overrides:
configureSerializerin classAbstractDesignerModuleHook
-
configureDeserializer
- Specified by:
configureDeserializerin interfaceDesignerModuleHook- Overrides:
configureDeserializerin classAbstractDesignerModuleHook
-
notifyProjectSaveStart
Description copied from interface:DesignerModuleHookNotifies the module that the user has requested that the project is saved. The module must check-in any checked-out resources that it is holding.- Specified by:
notifyProjectSaveStartin interfaceDesignerModuleHook- Overrides:
notifyProjectSaveStartin classAbstractDesignerModuleHook
-
notifyProjectSaveDone
public void notifyProjectSaveDone()Description copied from interface:DesignerModuleHookNotifies the module that the save operation has finished. This is the cue to check-out any previously checked-out resources that it was forced to check-in before the save.- Specified by:
notifyProjectSaveDonein interfaceDesignerModuleHook- Overrides:
notifyProjectSaveDonein classAbstractDesignerModuleHook
-
initSearchProviders
protected void initSearchProviders() -
notifyDesignableContainerClosed
-
setContext
-
getProject
-
getRoot
-
getHandler
-
getClientEventScriptEditor
-
addNewTemplate
-
addNewTemplate
public void addNewTemplate(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) -
addNewTemplate
-
addNewTemplate
public void addNewTemplate(ResourcePath parentFolder, VisionTemplate template, Consumer<ResourcePath> onFinished) -
newMainWindow
-
newMainWindow
-
createNewMainWindow
-
createNewDockedWindow
-
newDockedWindow
-
newDockedWindow
-
createNewPopupWindow
-
newPopupWindow
-
newPopupWindow
-
addNewWindow
-
windowResourceBuilder
public Consumer<ProjectResourceBuilder> windowResourceBuilder(FPMIWindow newWindow, boolean openOnStartIfFirst) -
addNewWindow
public void addNewWindow(ResourcePath parentFolder, FPMIWindow newWindow, Consumer<ResourcePath> onFinished) Adds a new window to theFHMIAppbeing designed -
getSelectedWindowFolder
Returns the id of the currently selected window folder in the project browser tree. -
getSelectedTemplateFolder
-
getRootFolderNode
-
getResourceEncoding
-
serializeProjectResource
Serializes an object to be stored in a ProjectResource. Serialized code is stored usingSerializationEncoding.BINARY. It is usually preferable to useserializeProjectResource(Object, SerializationEncoding)if the resource supports more than the binary format.- Throws:
SerializationException
-
serializeProjectResource
public byte[] serializeProjectResource(Object obj, SerializationEncoding encoding) throws SerializationException Serializes an object to be stored in a ProjectResource. Serialized code is stored based on the currentSerializationEncodingfor the vision project.- Throws:
SerializationException
-
addExtensibleBindingType
Description copied from interface:VisionClientInterfaceAdds a new binding type to be used in the extensible binding system- Specified by:
addExtensibleBindingTypein interfaceVisionClientInterface
-
getBindingType
- Specified by:
getBindingTypein interfaceVisionClientInterface
-
getGuiUtil
- Specified by:
getGuiUtilin interfaceVisionClientInterface
-
getGuiUtil
Description copied from interface:VisionClientInterfaceGets the WindowUtilities for a secondary desktop, by handle- Specified by:
getGuiUtilin interfaceVisionClientInterface
-
getExtensibleBindings
-
getPalette
- Specified by:
getPalettein interfaceVisionDesignerInterface
-
addNewWindow
public void addNewWindow(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) Description copied from interface:VisionDesignerInterfaceAdds a new window to theFPMIAppbeing designed- Specified by:
addNewWindowin interfaceVisionDesignerInterface
-
cloneComponent
- Specified by:
cloneComponentin interfaceVisionDesignerInterface
-
getCurrentPrefs
- Specified by:
getCurrentPrefsin interfaceVisionDesignerInterface
-
getWorkspace
- Specified by:
getWorkspacein interfaceVisionDesignerInterface
-
setWorkspace
-
getDesignerContext
- Specified by:
getDesignerContextin interfaceVisionDesignerInterface
-
openBindingDialog
Description copied from interface:VisionDesignerInterfaceOpens the binding dialog for a given component. The component should be on a window that is currently open for design- Specified by:
openBindingDialogin interfaceVisionDesignerInterface- Throws:
NotBindableException
-
configureBinding
public boolean configureBinding(Component component, String property, BindingConfiguration configuration) throws Exception Description copied from interface:VisionDesignerInterfaceConfigures a new property binding for the component.property using the given configuration. The binding type is defined by the configuration'sBindingConfiguration.getBindingType()- Specified by:
configureBindingin interfaceVisionDesignerInterface- Throws:
Exception
-
getRoles
- Throws:
GatewayException
-
getWindowResourceDescriptor
-
getTemplateResourceDescriptor
-