Class VisionDesignerImpl
java.lang.Object
com.inductiveautomation.ignition.designer.model.AbstractDesignerModuleHook
com.inductiveautomation.factorypmi.designer.model.VisionDesignerImpl
- All Implemented Interfaces:
LocationRenderingUpdater
,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 TypeMethodDescriptionvoid
void
addExtensibleBindingType
(BindingType binding) Adds a new binding type to be used in the extensible binding systemvoid
addNewTemplate
(ResourcePath parentFolder, int width, int height) void
addNewTemplate
(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) void
addNewTemplate
(ResourcePath parentFolder, VisionTemplate template) void
addNewTemplate
(ResourcePath parentFolder, VisionTemplate template, Consumer<ResourcePath> onFinished) void
addNewWindow
(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) Adds a new window to theFPMIApp
being designedvoid
addNewWindow
(ResourcePath parentFolder, FPMIWindow newWindow) void
addNewWindow
(ResourcePath parentFolder, FPMIWindow newWindow, Consumer<ResourcePath> onFinished) Adds a new window to theFHMIApp
being designedvoid
addWindowDropHandler
(WindowDropHandler handler) Add a new drop handler for custom drop types onto windows and templatesvoid
addWindowListener
(VisionWindowListener listener) Adds a listener to be notified when windows are opened and closed.cloneComponent
(Component comp) boolean
configureBinding
(Component component, String property, BindingConfiguration configuration) Configures a new property binding for the component.property using the given configuration.void
configureDeserializer
(XMLDeserializer deserializer) void
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 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()
Return an appropriate icon to display for this module.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) getResourceDisplayName
(ProjectResourceId resource) getResourceIcon
(ProjectResourceId resource) String[]
getRoot()
Returns the id of the currently selected window folder in the project browser tree.protected void
void
newDockedWindow
(ResourcePath parentFolder) void
newDockedWindow
(ResourcePath parentFolder, Consumer<ResourcePath> onFinished) void
newMainWindow
(ResourcePath folder) void
newMainWindow
(ResourcePath folder, Consumer<ResourcePath> onFinished) void
newPopupWindow
(ResourcePath parentFolder) void
newPopupWindow
(ResourcePath parentFolder, Consumer<ResourcePath> onFinished) void
notifyActivationStateChanged
(LicenseState licenseState) Notifies this designer module that its license state has changed.void
void
Notifies the module that the save operation has finished.void
Notifies the module that the user has requested that the project is saved.void
openBindingDialog
(Component component, String propertyName) Opens the binding dialog for a given component.void
void
removeWindowDropHandler
(WindowDropHandler handler) Removes a drop handler for custom drop types onto windows and templatesvoid
removeWindowListener
(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.void
setContext
(DesignerContext context) void
setWorkspace
(WindowWorkspace workspace) void
shutdown()
Called when the module is shut down.void
startup
(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.designer.model.DesignerModuleHook
getResourceCategoryKey, getResourceDisplayName, getResourceIcon, updateLocationRenderer
-
Field Details
-
MODULE_ID
- See Also:
-
-
Constructor Details
-
VisionDesignerImpl
public VisionDesignerImpl()
-
-
Method Details
-
startup
Description copied from interface:DesignerModuleHook
The 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:
startup
in interfaceDesignerModuleHook
- Overrides:
startup
in classAbstractDesignerModuleHook
- Throws:
Exception
- if the module was not able to be initialized for the given project.
-
shutdown
public void shutdown()Description copied from interface:DesignerModuleHook
Called 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:
shutdown
in interfaceDesignerModuleHook
- Overrides:
shutdown
in classAbstractDesignerModuleHook
-
addDesignableProjectListener
public void addDesignableProjectListener() -
removeDesignableProjectListener
public void removeDesignableProjectListener() -
addWindowDropHandler
Description copied from interface:VisionDesignerInterface
Add a new drop handler for custom drop types onto windows and templates- Specified by:
addWindowDropHandler
in interfaceVisionDesignerInterface
-
removeWindowDropHandler
Description copied from interface:VisionDesignerInterface
Removes a drop handler for custom drop types onto windows and templates- Specified by:
removeWindowDropHandler
in interfaceVisionDesignerInterface
-
getWindowDropHandlers
-
getResourceCategoryKey
- Specified by:
getResourceCategoryKey
in interfaceDesignerModuleHook
- Overrides:
getResourceCategoryKey
in classAbstractDesignerModuleHook
-
getResourceDisplayName
- Specified by:
getResourceDisplayName
in interfaceDesignerModuleHook
- Overrides:
getResourceDisplayName
in classAbstractDesignerModuleHook
-
getResourceIcon
- Specified by:
getResourceIcon
in interfaceDesignerModuleHook
- Overrides:
getResourceIcon
in classAbstractDesignerModuleHook
-
getModuleMenu
Description copied from interface:DesignerModuleHook
Returns a menu merge for any global menu additions. May be null.- Specified by:
getModuleMenu
in interfaceDesignerModuleHook
- Overrides:
getModuleMenu
in classAbstractDesignerModuleHook
- See Also:
-
getMenu
- Returns:
- the
MenuBarMerge
specific to the vision workspace
-
getModuleToolbars
Description copied from interface:DesignerModuleHook
Returns the toolbars for the module. May be empty but not null.- Specified by:
getModuleToolbars
in interfaceDesignerModuleHook
- Overrides:
getModuleToolbars
in classAbstractDesignerModuleHook
-
getFrames
Description copied from interface:DesignerModuleHook
A list of DockableFrames that this module provides, that should be available to all workspaces.- Specified by:
getFrames
in interfaceDesignerModuleHook
- Overrides:
getFrames
in classAbstractDesignerModuleHook
-
notifyActivationStateChanged
Description copied from interface:DesignerModuleHook
Notifies 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:
notifyActivationStateChanged
in interfaceDesignerModuleHook
- Overrides:
notifyActivationStateChanged
in classAbstractDesignerModuleHook
-
addWindowListener
Description copied from interface:VisionClientInterface
Adds a listener to be notified when windows are opened and closed. Only works during runtime, not designer- Specified by:
addWindowListener
in interfaceVisionClientInterface
-
removeWindowListener
Description copied from interface:VisionClientInterface
Removes window listener- Specified by:
removeWindowListener
in interfaceVisionClientInterface
-
configureSerializer
Description copied from interface:DesignerModuleHook
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 module- Specified by:
configureSerializer
in interfaceDesignerModuleHook
- Overrides:
configureSerializer
in classAbstractDesignerModuleHook
-
configureDeserializer
- Specified by:
configureDeserializer
in interfaceDesignerModuleHook
- Overrides:
configureDeserializer
in classAbstractDesignerModuleHook
-
notifyProjectSaveStart
Description copied from interface:DesignerModuleHook
Notifies 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:
notifyProjectSaveStart
in interfaceDesignerModuleHook
- Overrides:
notifyProjectSaveStart
in classAbstractDesignerModuleHook
-
notifyProjectSaveDone
public void notifyProjectSaveDone()Description copied from interface:DesignerModuleHook
Notifies 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:
notifyProjectSaveDone
in interfaceDesignerModuleHook
- Overrides:
notifyProjectSaveDone
in classAbstractDesignerModuleHook
-
initSearchProviders
protected void initSearchProviders() -
getModuleIcon
Description copied from interface:DesignerModuleHook
Return an appropriate icon to display for this module. Ideally, anInteractiveIcon
of some kind.- Specified by:
getModuleIcon
in interfaceDesignerModuleHook
- See Also:
-
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 theFHMIApp
being 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 currentSerializationEncoding
for the vision project.- Throws:
SerializationException
-
addExtensibleBindingType
Description copied from interface:VisionClientInterface
Adds a new binding type to be used in the extensible binding system- Specified by:
addExtensibleBindingType
in interfaceVisionClientInterface
-
getBindingType
- Specified by:
getBindingType
in interfaceVisionClientInterface
-
getGuiUtil
- Specified by:
getGuiUtil
in interfaceVisionClientInterface
-
getGuiUtil
Description copied from interface:VisionClientInterface
Gets the WindowUtilities for a secondary desktop, by handle- Specified by:
getGuiUtil
in interfaceVisionClientInterface
-
getExtensibleBindings
-
getPalette
- Specified by:
getPalette
in interfaceVisionDesignerInterface
-
addNewWindow
public void addNewWindow(ResourcePath parentFolder, int width, int height, Consumer<ResourcePath> onAfter) Description copied from interface:VisionDesignerInterface
Adds a new window to theFPMIApp
being designed- Specified by:
addNewWindow
in interfaceVisionDesignerInterface
-
cloneComponent
- Specified by:
cloneComponent
in interfaceVisionDesignerInterface
-
getCurrentPrefs
- Specified by:
getCurrentPrefs
in interfaceVisionDesignerInterface
-
getWorkspace
- Specified by:
getWorkspace
in interfaceVisionDesignerInterface
-
setWorkspace
-
getDesignerContext
- Specified by:
getDesignerContext
in interfaceVisionDesignerInterface
-
openBindingDialog
Description copied from interface:VisionDesignerInterface
Opens the binding dialog for a given component. The component should be on a window that is currently open for design- Specified by:
openBindingDialog
in interfaceVisionDesignerInterface
- Throws:
NotBindableException
-
configureBinding
public boolean configureBinding(Component component, String property, BindingConfiguration configuration) throws Exception Description copied from interface:VisionDesignerInterface
Configures a new property binding for the component.property using the given configuration. The binding type is defined by the configuration'sBindingConfiguration.getBindingType()
- Specified by:
configureBinding
in interfaceVisionDesignerInterface
- Throws:
Exception
-
getRoles
- Throws:
GatewayException
-
getWindowResourceDescriptor
-
getTemplateResourceDescriptor
-