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 bothDesignerModuleHookandVisionDesignerInterface. Most of the heavy lifting is actually done in theWindowWorkspaceclass.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classVisionDesignerImpl.Handler
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringMODULE_ID- 
Fields inherited from interface com.inductiveautomation.vision.api.client.VisionClientInterfaceVISION_MODULE_ID
 
- 
 - 
Constructor SummaryConstructors Constructor Description VisionDesignerImpl()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDesignableProjectListener()voidaddExtensibleBindingType(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, java.util.function.Consumer<ResourcePath> onAfter)voidaddNewTemplate(ResourcePath parentFolder, VisionTemplate template)voidaddNewTemplate(ResourcePath parentFolder, VisionTemplate template, java.util.function.Consumer<ResourcePath> onFinished)voidaddNewWindow(ResourcePath parentFolder, int width, int height, java.util.function.Consumer<ResourcePath> onAfter)Adds a new window to theFPMIAppbeing designedvoidaddNewWindow(ResourcePath parentFolder, FPMIWindow newWindow)voidaddNewWindow(ResourcePath parentFolder, FPMIWindow newWindow, java.util.function.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.java.awt.ComponentcloneComponent(java.awt.Component comp)booleanconfigureBinding(java.awt.Component component, java.lang.String property, BindingConfiguration configuration)Configures a new property binding for the component.property using the given configuration.voidconfigureDeserializer(XMLDeserializer deserializer)voidconfigureSerializer(XMLSerializer s)Provides the module a chance to add serialization delegates to the serializer custom for classes that might be encountered when serializing objects provided by this moduleFPMIWindowcreateNewDockedWindow(int width, int height, int side)FPMIWindowcreateNewMainWindow()FPMIWindowcreateNewPopupWindow()BindingTypegetBindingType(java.lang.String bindingTypeKey)ClientScriptEditorgetClientEventScriptEditor()DesignerPrefsgetCurrentPrefs()DesignerContextgetDesignerContext()java.util.Collection<BindingType>getExtensibleBindings()java.util.List<com.jidesoft.docking.DockableFrame>getFrames()A list of DockableFrames that this module provides, that should be available to all workspaces.WindowUtilitiesgetGuiUtil()WindowUtilitiesgetGuiUtil(java.lang.String desktopHandle)Gets the WindowUtilities for a secondary desktop, by handleVisionDesignerImpl.HandlergetHandler()MenuBarMergegetMenu()MenuBarMergegetModuleMenu()Returns a menu merge for any global menu additions.java.util.List<com.jidesoft.action.CommandBar>getModuleToolbars()Returns the toolbars for the module.NavUtilitiesgetNavUtil()Gets the NavUtilities (for the primary desktopNavUtilitiesgetNavUtil(java.lang.String desktopHandle)Gets the NavUtilities for a secondary desktop, by handlePaletteImplgetPalette()DesignableProjectgetProject()java.lang.StringgetResourceCategoryKey(ProjectResourceId resource)Used by modules that add project resources to an Ignition project.java.lang.StringgetResourceDisplayName(ProjectResourceId resource)Allows a module to give an appropriate display name for the resource.javax.swing.IcongetResourceIcon(ProjectResourceId resource)Allows a module to give an appropriate icon for a resource.java.lang.String[]getRoles(java.awt.Component owner)FPMIAppgetRoot()WindowFolderNodegetRootFolderNode()ResourcePathgetSelectedTemplateFolder()ResourcePathgetSelectedWindowFolder()Returns the id of the currently selected window folder in the project browser tree.ResourceDescriptorgetTemplateResourceDescriptor()java.util.List<WindowDropHandler>getWindowDropHandlers()ResourceDescriptorgetWindowResourceDescriptor()WindowWorkspacegetWorkspace()protected voidinitSearchProviders()voidnewDockedWindow(ResourcePath parentFolder)voidnewDockedWindow(ResourcePath parentFolder, java.util.function.Consumer<ResourcePath> onFinished)voidnewMainWindow(ResourcePath folder)voidnewMainWindow(ResourcePath folder, java.util.function.Consumer<ResourcePath> onFinished)voidnewPopupWindow(ResourcePath parentFolder)voidnewPopupWindow(ResourcePath parentFolder, java.util.function.Consumer<ResourcePath> onFinished)voidnotifyActivationStateChanged(LicenseState licenseState)Notifies this designer module that its license state has changed.voidnotifyDesignableContainerClosed(ResourcePath path)voidnotifyProjectSaveDone()Notifies the module that the save operation has finished.voidnotifyProjectSaveStart(SaveContext save)Notifies the module that the user has requested that the project is saved.voidopenBindingDialog(java.awt.Component component, java.lang.String propertyName)Opens the binding dialog for a given component.voidremoveDesignableProjectListener()voidremoveWindowDropHandler(WindowDropHandler handler)Removes a drop handler for custom drop types onto windows and templatesvoidremoveWindowListener(VisionWindowListener listiner)Removes window listenerbyte[]serializeProjectResource(java.lang.Object obj)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.java.util.function.Consumer<ProjectResourceBuilder>windowResourceBuilder(FPMIWindow newWindow, boolean openOnStartIfFirst)- 
Methods inherited from class com.inductiveautomation.ignition.designer.model.AbstractDesignerModuleHookconfigureFunctionFactory, createPermissionKeys, initializeScriptManager
 
- 
 
- 
- 
- 
Field Detail- 
MODULE_IDpublic static final java.lang.String MODULE_ID - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
startuppublic void startup(DesignerContext designerContext, LicenseState activationState) throws java.lang.Exception 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 interface- DesignerModuleHook
- Overrides:
- startupin class- AbstractDesignerModuleHook
- Throws:
- java.lang.Exception- if the module was not able to be initialized for the given project.
 
 - 
shutdownpublic 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 interface- DesignerModuleHook
- Overrides:
- shutdownin class- AbstractDesignerModuleHook
 
 - 
addDesignableProjectListenerpublic void addDesignableProjectListener() 
 - 
removeDesignableProjectListenerpublic void removeDesignableProjectListener() 
 - 
addWindowDropHandlerpublic void addWindowDropHandler(WindowDropHandler handler) Description copied from interface:VisionDesignerInterfaceAdd a new drop handler for custom drop types onto windows and templates- Specified by:
- addWindowDropHandlerin interface- VisionDesignerInterface
 
 - 
removeWindowDropHandlerpublic void removeWindowDropHandler(WindowDropHandler handler) Description copied from interface:VisionDesignerInterfaceRemoves a drop handler for custom drop types onto windows and templates- Specified by:
- removeWindowDropHandlerin interface- VisionDesignerInterface
 
 - 
getWindowDropHandlerspublic java.util.List<WindowDropHandler> getWindowDropHandlers() 
 - 
getResourceCategoryKeypublic java.lang.String getResourceCategoryKey(ProjectResourceId resource) 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 interface- DesignerModuleHook
- Overrides:
- getResourceCategoryKeyin class- AbstractDesignerModuleHook
- Parameters:
- resource- A project resource that was added by this module.
- Returns:
- A bundle resource key for the category of this resource.
 
 - 
getResourceDisplayNamepublic java.lang.String getResourceDisplayName(ProjectResourceId resource) 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 interface- DesignerModuleHook
- Overrides:
- getResourceDisplayNamein class- AbstractDesignerModuleHook
- Returns:
- the name for a resource, or null to use the resource's folder path/name.
 
 - 
getResourceIconpublic javax.swing.Icon getResourceIcon(ProjectResourceId resource) Description copied from interface:DesignerModuleHookAllows a module to give an appropriate icon for a resource. Used by the import/export system. - Specified by:
- getResourceIconin interface- DesignerModuleHook
- Overrides:
- getResourceIconin class- AbstractDesignerModuleHook
 
 - 
getModuleMenupublic MenuBarMerge getModuleMenu() Description copied from interface:DesignerModuleHookReturns a menu merge for any global menu additions. May be null.- Specified by:
- getModuleMenuin interface- DesignerModuleHook
- Overrides:
- getModuleMenuin class- AbstractDesignerModuleHook
- See Also:
- JMenuMerge
 
 - 
getMenupublic MenuBarMerge getMenu() - Returns:
- the MenuBarMergespecific to the vision workspace
 
 - 
getModuleToolbars@Nonnull public java.util.List<com.jidesoft.action.CommandBar> getModuleToolbars() Description copied from interface:DesignerModuleHookReturns the toolbars for the module. May be empty but not null.- Specified by:
- getModuleToolbarsin interface- DesignerModuleHook
- Overrides:
- getModuleToolbarsin class- AbstractDesignerModuleHook
 
 - 
getFrames@Nonnull public java.util.List<com.jidesoft.docking.DockableFrame> getFrames() Description copied from interface:DesignerModuleHookA list of DockableFrames that this module provides, that should be available to all workspaces.- Specified by:
- getFramesin interface- DesignerModuleHook
- Overrides:
- getFramesin class- AbstractDesignerModuleHook
 
 - 
notifyActivationStateChangedpublic void notifyActivationStateChanged(LicenseState licenseState) 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 interface- DesignerModuleHook
- Overrides:
- notifyActivationStateChangedin class- AbstractDesignerModuleHook
 
 - 
addWindowListenerpublic void addWindowListener(VisionWindowListener listener) 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 interface- VisionClientInterface
 
 - 
removeWindowListenerpublic void removeWindowListener(VisionWindowListener listiner) Description copied from interface:VisionClientInterfaceRemoves window listener- Specified by:
- removeWindowListenerin interface- VisionClientInterface
 
 - 
configureSerializerpublic void configureSerializer(XMLSerializer s) 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 interface- DesignerModuleHook
- Overrides:
- configureSerializerin class- AbstractDesignerModuleHook
 
 - 
configureDeserializerpublic void configureDeserializer(XMLDeserializer deserializer) - Specified by:
- configureDeserializerin interface- DesignerModuleHook
- Overrides:
- configureDeserializerin class- AbstractDesignerModuleHook
 
 - 
notifyProjectSaveStartpublic void notifyProjectSaveStart(SaveContext save) 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 interface- DesignerModuleHook
- Overrides:
- notifyProjectSaveStartin class- AbstractDesignerModuleHook
 
 - 
notifyProjectSaveDonepublic 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 interface- DesignerModuleHook
- Overrides:
- notifyProjectSaveDonein class- AbstractDesignerModuleHook
 
 - 
initSearchProvidersprotected void initSearchProviders() 
 - 
notifyDesignableContainerClosedpublic void notifyDesignableContainerClosed(ResourcePath path) 
 - 
setContextpublic void setContext(DesignerContext context) 
 - 
getProjectpublic DesignableProject getProject() 
 - 
getRootpublic FPMIApp getRoot() 
 - 
getHandlerpublic VisionDesignerImpl.Handler getHandler() 
 - 
getClientEventScriptEditorpublic ClientScriptEditor getClientEventScriptEditor() 
 - 
addNewTemplatepublic void addNewTemplate(ResourcePath parentFolder, int width, int height) 
 - 
addNewTemplatepublic void addNewTemplate(ResourcePath parentFolder, int width, int height, java.util.function.Consumer<ResourcePath> onAfter) 
 - 
addNewTemplatepublic void addNewTemplate(ResourcePath parentFolder, VisionTemplate template) 
 - 
addNewTemplatepublic void addNewTemplate(ResourcePath parentFolder, VisionTemplate template, java.util.function.Consumer<ResourcePath> onFinished) 
 - 
newMainWindowpublic void newMainWindow(ResourcePath folder) 
 - 
newMainWindowpublic void newMainWindow(ResourcePath folder, java.util.function.Consumer<ResourcePath> onFinished) 
 - 
createNewMainWindowpublic FPMIWindow createNewMainWindow() 
 - 
createNewDockedWindowpublic FPMIWindow createNewDockedWindow(int width, int height, int side) 
 - 
newDockedWindowpublic void newDockedWindow(ResourcePath parentFolder) 
 - 
newDockedWindowpublic void newDockedWindow(ResourcePath parentFolder, java.util.function.Consumer<ResourcePath> onFinished) 
 - 
createNewPopupWindowpublic FPMIWindow createNewPopupWindow() 
 - 
newPopupWindowpublic void newPopupWindow(ResourcePath parentFolder) 
 - 
newPopupWindowpublic void newPopupWindow(ResourcePath parentFolder, java.util.function.Consumer<ResourcePath> onFinished) 
 - 
addNewWindowpublic void addNewWindow(ResourcePath parentFolder, FPMIWindow newWindow) 
 - 
windowResourceBuilderpublic java.util.function.Consumer<ProjectResourceBuilder> windowResourceBuilder(FPMIWindow newWindow, boolean openOnStartIfFirst) 
 - 
addNewWindowpublic void addNewWindow(ResourcePath parentFolder, FPMIWindow newWindow, java.util.function.Consumer<ResourcePath> onFinished) Adds a new window to theFHMIAppbeing designed
 - 
getSelectedWindowFolderpublic ResourcePath getSelectedWindowFolder() Returns the id of the currently selected window folder in the project browser tree.
 - 
getSelectedTemplateFolderpublic ResourcePath getSelectedTemplateFolder() 
 - 
getRootFolderNodepublic WindowFolderNode getRootFolderNode() 
 - 
serializeProjectResourcepublic byte[] serializeProjectResource(java.lang.Object obj) throws SerializationExceptionSerializes an object to be stored in a ProjectResource. Serialized code is stored in a GZipped byte array.- Throws:
- SerializationException
 
 - 
addExtensibleBindingTypepublic void addExtensibleBindingType(BindingType binding) Description copied from interface:VisionClientInterfaceAdds a new binding type to be used in the extensible binding system- Specified by:
- addExtensibleBindingTypein interface- VisionClientInterface
 
 - 
getBindingTypepublic BindingType getBindingType(java.lang.String bindingTypeKey) - Specified by:
- getBindingTypein interface- VisionClientInterface
 
 - 
getNavUtilpublic NavUtilities getNavUtil() Description copied from interface:VisionClientInterfaceGets the NavUtilities (for the primary desktop- Specified by:
- getNavUtilin interface- VisionClientInterface
 
 - 
getNavUtilpublic NavUtilities getNavUtil(java.lang.String desktopHandle) Description copied from interface:VisionClientInterfaceGets the NavUtilities for a secondary desktop, by handle- Specified by:
- getNavUtilin interface- VisionClientInterface
 
 - 
getGuiUtilpublic WindowUtilities getGuiUtil() - Specified by:
- getGuiUtilin interface- VisionClientInterface
 
 - 
getGuiUtilpublic WindowUtilities getGuiUtil(java.lang.String desktopHandle) Description copied from interface:VisionClientInterfaceGets the WindowUtilities for a secondary desktop, by handle- Specified by:
- getGuiUtilin interface- VisionClientInterface
 
 - 
getExtensibleBindingspublic java.util.Collection<BindingType> getExtensibleBindings() 
 - 
getPalettepublic PaletteImpl getPalette() - Specified by:
- getPalettein interface- VisionDesignerInterface
 
 - 
addNewWindowpublic void addNewWindow(ResourcePath parentFolder, int width, int height, java.util.function.Consumer<ResourcePath> onAfter) Description copied from interface:VisionDesignerInterfaceAdds a new window to theFPMIAppbeing designed- Specified by:
- addNewWindowin interface- VisionDesignerInterface
 
 - 
cloneComponentpublic java.awt.Component cloneComponent(java.awt.Component comp) - Specified by:
- cloneComponentin interface- VisionDesignerInterface
 
 - 
getCurrentPrefspublic DesignerPrefs getCurrentPrefs() - Specified by:
- getCurrentPrefsin interface- VisionDesignerInterface
 
 - 
getWorkspacepublic WindowWorkspace getWorkspace() - Specified by:
- getWorkspacein interface- VisionDesignerInterface
 
 - 
setWorkspacepublic void setWorkspace(WindowWorkspace workspace) 
 - 
getDesignerContextpublic DesignerContext getDesignerContext() - Specified by:
- getDesignerContextin interface- VisionDesignerInterface
 
 - 
openBindingDialogpublic void openBindingDialog(java.awt.Component component, java.lang.String propertyName) throws NotBindableExceptionDescription 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 interface- VisionDesignerInterface
- Throws:
- NotBindableException
 
 - 
configureBindingpublic boolean configureBinding(java.awt.Component component, java.lang.String property, BindingConfiguration configuration) throws java.lang.ExceptionDescription 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 interface- VisionDesignerInterface
- Throws:
- java.lang.Exception
 
 - 
getRolespublic java.lang.String[] getRoles(@Nullable java.awt.Component owner) throws GatewayException- Throws:
- GatewayException
 
 - 
getWindowResourceDescriptorpublic ResourceDescriptor getWindowResourceDescriptor() 
 - 
getTemplateResourceDescriptorpublic ResourceDescriptor getTemplateResourceDescriptor() 
 
- 
 
-