Class DesignerContextImpl
- java.lang.Object
-
- com.inductiveautomation.ignition.client.model.AbstractClientContext
-
- com.inductiveautomation.ignition.designer.DesignerContextImpl
-
- All Implemented Interfaces:
ClientContext,CommonContext,DesignerContext
public class DesignerContextImpl extends AbstractClientContext implements DesignerContext
-
-
Field Summary
Fields Modifier and Type Field Description protected IgnitionDesignerdesignerGui-
Fields inherited from class com.inductiveautomation.ignition.client.model.AbstractClientContext
changeSupport, globalProps, log, loggingManager, project
-
-
Constructor Summary
Constructors Constructor Description DesignerContextImpl(IgnitionDesigner designerGui, LaunchContext launchContext, DesignableProject project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBeanInfoSearchPath(@NotNull java.lang.String packageName)Adds the given fully-qualified path name to the Introspector's BeanInfo search path.voidaddLegacyScriptNode()Adds the Legacy Script project node for pre-7.7 script modules that have been imported by the user.voidaddPropertyEditor(@NotNull java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)Adds a property editor page that will be incorporated into the Designer's project property editing system.booleancanEditResourceProtection()Checks whether or not the current logged in user can edit the protection bits of project resources.XMLDeserializercreateDeserializer()Returns an instance of the XMLDeserializer that can be used to deserialize project resources.FunctionFactorycreateExpressionFunctionFactory()XMLSerializercreateSerializer()Creates a new XML serializer that has been configured by all installed modules for custom serialization delegatesjava.lang.Objectdeserialize(byte[] data, org.apache.log4j.Logger log)Convenience function to deserialize a gzipped byte array into a single object.voideditResourceDocs(@NotNull ProjectResource resource)Opens up the resource notes editor for the given project resourcesvoidexportResources(@NotNull java.util.Collection<ResourcePath> resourceIds)Shows the project export window (after doing a commit) with the given resource IDs checked.@NotNull java.util.Map<java.lang.String,java.lang.String>getClientPermissionBundleKeys()@NotNull javax.swing.ActiongetCopyAction()@NotNull javax.swing.ActiongetCutAction()@NotNull javax.swing.ActiongetDeleteAction()@NotNull PersistentPropertiesgetDesignerPrefs()Returns a PersistentProperties file that will be stored on a per-user basis for "persistent" but not project-encapsulated preferences@NotNull com.jidesoft.docking.DockingManagergetDockingManager()Returns the JIDE DockingManager for the DesignerExecutionManagergetExecutionManager()Returns the shared task execution manager for this client@NotNull java.awt.FramegetFrame()Returns the owning frame of the designer.LicenseStategetLicenseState(java.lang.String moduleId)Returns the license state for the given module@NotNull DesignerLocalizationManagergetLocalizationManager()protected LoggerExgetLogger()java.lang.ObjectgetModule(java.lang.String id)Returns the hook class for another module, used for modules that deal with each other's models.java.util.List<ModuleInfo>getModules()Retrieve the list of all modules currently loaded in this contextNamedQueryManagergetNamedQueryManager()Returns the appropriate named query rpc for the context.@NotNull OPCBrowserPanelgetOPCBrowser()Returns the OPCBrowserPanel that can be used to browse and import OPC items@NotNull javax.swing.ActiongetPasteAction()DesignerProjectTreeImplgetProject()@NotNull ProjectBrowserRootgetProjectBrowserRoot()Returns the root node of the project browser tree, so that modules may add their own nodes.@NotNull QueryBrowsergetQueryBrowserPanel()Returns the DB query browser tooljava.lang.StringgetResourceCategoryKey(ProjectResourceId id)java.lang.StringgetResourceDisplayName(ProjectResourceId id)javax.swing.IcongetResourceIcon(ProjectResourceId id)javax.swing.RootPaneContainergetRootPaneContainer()Returns the RootPaneContainer that is currently the owner of the clientScriptManagergetScriptManager()Returns the ScriptManager that can be used to execute Python scripts.@NotNull java.util.List<SearchProvider>getSearchProviders()Get the registered SearchProviders.StatusBargetStatusBar()The StatusBar at the bottom of the Designer can be used to display temporary messages and for adding always-present little components that appear in the bottom-right@NotNull TagBrowserPanelgetTagBrowser()Returns the TagBrowserPanel that can be used to select Tags@NotNull TagEditorgetTagEditor()Returns the TagEditorPanel that can be used to edit/add TagsClientTagManagergetTagManager()Returns the manager that provides access to Ignition's tag system.@NotNull com.jidesoft.action.DockableBarManagergetToolbarManager()Returns the JIDE dockable toolbar managervoidregisterClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)Register id-bundlekey pairs to limit client permissionsvoidregisterResourceWorkspace(@NotNull ResourceWorkspace workspace)Registers a newResourceWorkspace, which is a main editing area for the designer.voidregisterSearchProvider(@NotNull SearchProvider provider)Registers a search provider that will be exposed through the find/replace system.protected voidshowError(java.lang.Exception e)protected voidshowError(java.lang.String message)protected voidshowError(java.lang.String message, java.lang.Exception e)voidshutdown()-
Methods inherited from class com.inductiveautomation.ignition.client.model.AbstractClientContext
addPropertyChangeListener, addPropertyChangeListener, getAuthProfileName, getDefaultDatasourceName, getDefaultTagProviderName, getEventBus, getExpressionFunctionFactory, getGlobalProps, getLaunchContext, getLoggingManager, getProgressManager, getTagPollRate, getUIEventBus, initProject, resetExpressionFunctionFactory, setGlobalProps, updateGlobalProps
-
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.client.model.ClientContext
addPropertyChangeListener, addPropertyChangeListener, getAuthProfileName, getDefaultDatasourceName, getDefaultTagProviderName, getLaunchContext, getProgressManager, getTagPollRate, getUIEventBus
-
Methods inherited from interface com.inductiveautomation.ignition.common.model.CommonContext
getEventBus, getExpressionFunctionFactory, getLoggingManager
-
-
-
-
Field Detail
-
designerGui
protected IgnitionDesigner designerGui
-
-
Constructor Detail
-
DesignerContextImpl
public DesignerContextImpl(IgnitionDesigner designerGui, LaunchContext launchContext, DesignableProject project)
-
-
Method Detail
-
getProject
public DesignerProjectTreeImpl getProject()
- Specified by:
getProjectin interfaceClientContext- Specified by:
getProjectin interfaceDesignerContext
-
getLocalizationManager
@NotNull public @NotNull DesignerLocalizationManager getLocalizationManager()
- Specified by:
getLocalizationManagerin interfaceClientContext- Specified by:
getLocalizationManagerin interfaceDesignerContext
-
getNamedQueryManager
public NamedQueryManager getNamedQueryManager()
Description copied from interface:ClientContextReturns the appropriate named query rpc for the context. In the gateway and client, we only want to use named queries that have been saved. In the designer, we want to use the current version so that reports and bindings can be seen and used for testing before the project is saved.- Specified by:
getNamedQueryManagerin interfaceClientContext- Returns:
- The correct NamedQueryManager implementation for the scope.
-
getExecutionManager
public ExecutionManager getExecutionManager()
Description copied from interface:ClientContextReturns the shared task execution manager for this client- Specified by:
getExecutionManagerin interfaceClientContext
-
getModule
public java.lang.Object getModule(java.lang.String id)
Description copied from interface:CommonContextReturns the hook class for another module, used for modules that deal with each other's models. Example: The reporting plugin's designer hook uses this to get FactoryPMI's palette.- Specified by:
getModulein interfaceCommonContext
-
getModules
public java.util.List<ModuleInfo> getModules()
Description copied from interface:ClientContextRetrieve the list of all modules currently loaded in this context- Specified by:
getModulesin interfaceClientContext
-
getLicenseState
public LicenseState getLicenseState(java.lang.String moduleId)
Description copied from interface:CommonContextReturns the license state for the given module- Specified by:
getLicenseStatein interfaceCommonContext
-
exportResources
public void exportResources(@NotNull @NotNull java.util.Collection<ResourcePath> resourceIds)Description copied from interface:DesignerContextShows the project export window (after doing a commit) with the given resource IDs checked.- Specified by:
exportResourcesin interfaceDesignerContext- Parameters:
resourceIds- Collection of ProjectResourceIds. Not null, but may be empty.
-
createExpressionFunctionFactory
public FunctionFactory createExpressionFunctionFactory()
- Specified by:
createExpressionFunctionFactoryin classAbstractClientContext
-
getResourceCategoryKey
public java.lang.String getResourceCategoryKey(@Nonnull ProjectResourceId id)
-
getResourceDisplayName
public java.lang.String getResourceDisplayName(@Nonnull ProjectResourceId id)
-
getResourceIcon
public javax.swing.Icon getResourceIcon(@Nonnull ProjectResourceId id)
-
registerResourceWorkspace
public void registerResourceWorkspace(@NotNull @NotNull ResourceWorkspace workspace)Description copied from interface:DesignerContextRegisters a newResourceWorkspace, which is a main editing area for the designer. The workspace has menus and toolbars associated with it that become visible when the workspace is focused.- Specified by:
registerResourceWorkspacein interfaceDesignerContext- Parameters:
workspace- TheResourceWorkspaceto register with the designer
-
getSearchProviders
@NotNull public @NotNull java.util.List<SearchProvider> getSearchProviders()
Description copied from interface:DesignerContextGet the registered SearchProviders.- Specified by:
getSearchProvidersin interfaceDesignerContext- Returns:
- Not null.
-
registerClientPermissions
public void registerClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)
Description copied from interface:DesignerContextRegister id-bundlekey pairs to limit client permissions- Specified by:
registerClientPermissionsin interfaceDesignerContext- Parameters:
bundleMap- Map of ids to bundlekeys. Not null.
-
getClientPermissionBundleKeys
@NotNull public @NotNull java.util.Map<java.lang.String,java.lang.String> getClientPermissionBundleKeys()
- Specified by:
getClientPermissionBundleKeysin interfaceDesignerContext
-
registerSearchProvider
public void registerSearchProvider(@NotNull @NotNull SearchProvider provider)Description copied from interface:DesignerContextRegisters a search provider that will be exposed through the find/replace system.- Specified by:
registerSearchProviderin interfaceDesignerContext
-
getFrame
@NotNull public @NotNull java.awt.Frame getFrame()
Description copied from interface:DesignerContextReturns the owning frame of the designer. Handy for dialog parents- Specified by:
getFramein interfaceDesignerContext
-
getCutAction
@NotNull public @NotNull javax.swing.Action getCutAction()
- Specified by:
getCutActionin interfaceDesignerContext
-
getCopyAction
@NotNull public @NotNull javax.swing.Action getCopyAction()
- Specified by:
getCopyActionin interfaceDesignerContext
-
getPasteAction
@NotNull public @NotNull javax.swing.Action getPasteAction()
- Specified by:
getPasteActionin interfaceDesignerContext
-
getDeleteAction
@NotNull public @NotNull javax.swing.Action getDeleteAction()
- Specified by:
getDeleteActionin interfaceDesignerContext
-
getTagManager
public ClientTagManager getTagManager()
Description copied from interface:CommonContextReturns the manager that provides access to Ignition's tag system.- Specified by:
getTagManagerin interfaceClientContext- Specified by:
getTagManagerin interfaceCommonContext
-
addBeanInfoSearchPath
public void addBeanInfoSearchPath(@NotNull @NotNull java.lang.String packageName)Description copied from interface:DesignerContextAdds the given fully-qualified path name to the Introspector's BeanInfo search path. BeanInfos can be important for not only visual beans, but for controlling serialization.- Specified by:
addBeanInfoSearchPathin interfaceDesignerContext- Parameters:
packageName- fully-qualified path name. Not null.
-
createSerializer
public XMLSerializer createSerializer()
Description copied from interface:DesignerContextCreates a new XML serializer that has been configured by all installed modules for custom serialization delegates- Specified by:
createSerializerin interfaceDesignerContext- Returns:
- Not null.
-
createDeserializer
public XMLDeserializer createDeserializer()
Description copied from interface:CommonContextReturns an instance of the XMLDeserializer that can be used to deserialize project resources. Note that this is the only safe way to obtain an instance of XMLDeserializer, because the context will pass the new deserializer around to all loaded modules, giving them a chance to initialize any custom deserialization deletes on it first.- Specified by:
createDeserializerin interfaceCommonContext
-
getStatusBar
public StatusBar getStatusBar()
Description copied from interface:DesignerContextThe StatusBar at the bottom of the Designer can be used to display temporary messages and for adding always-present little components that appear in the bottom-right- Specified by:
getStatusBarin interfaceDesignerContext- Returns:
- Not null.
-
shutdown
public void shutdown()
-
getRootPaneContainer
public javax.swing.RootPaneContainer getRootPaneContainer()
Description copied from interface:ClientContextReturns the RootPaneContainer that is currently the owner of the client- Specified by:
getRootPaneContainerin interfaceClientContext
-
getProjectBrowserRoot
@NotNull public @NotNull ProjectBrowserRoot getProjectBrowserRoot()
Description copied from interface:DesignerContextReturns the root node of the project browser tree, so that modules may add their own nodes.- Specified by:
getProjectBrowserRootin interfaceDesignerContext- See Also:
AbstractNavTreeNode
-
deserialize
public java.lang.Object deserialize(byte[] data, org.apache.log4j.Logger log) throws SerializationExceptionDescription copied from interface:ClientContextConvenience function to deserialize a gzipped byte array into a single object. If multiple objects are found, they will be discarded. Warnings are logged to the given logger. If data is null or empty, null is returned.- Specified by:
deserializein interfaceClientContext- Throws:
SerializationException
-
addPropertyEditor
public void addPropertyEditor(@NotNull @NotNull java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)Description copied from interface:DesignerContextAdds a property editor page that will be incorporated into the Designer's project property editing system. This class will be instantiated the first time that the property editor is displayed, and must have either a nullary constructor or a constructor that takes a DesignerContext.
The Property Editing framework is designed around the idea that modules will store properties in opaquely xml-serialized project resources which can be uniquely identified by their module ID and resource type. The property editing UI will handle the de/serialization and project syncing tasks so that the property editor pages can simply focus on UI.
- Specified by:
addPropertyEditorin interfaceDesignerContext
-
getScriptManager
public ScriptManager getScriptManager()
Description copied from interface:CommonContextReturns the ScriptManager that can be used to execute Python scripts.- Specified by:
getScriptManagerin interfaceCommonContext
-
getDockingManager
@NotNull public @NotNull com.jidesoft.docking.DockingManager getDockingManager()
Description copied from interface:DesignerContextReturns the JIDE DockingManager for the Designer- Specified by:
getDockingManagerin interfaceDesignerContext
-
getToolbarManager
@NotNull public @NotNull com.jidesoft.action.DockableBarManager getToolbarManager()
Description copied from interface:DesignerContextReturns the JIDE dockable toolbar manager- Specified by:
getToolbarManagerin interfaceDesignerContext
-
getTagEditor
@NotNull public @NotNull TagEditor getTagEditor()
Description copied from interface:DesignerContextReturns the TagEditorPanel that can be used to edit/add Tags- Specified by:
getTagEditorin interfaceDesignerContext
-
getTagBrowser
@NotNull public @NotNull TagBrowserPanel getTagBrowser()
Description copied from interface:DesignerContextReturns the TagBrowserPanel that can be used to select Tags- Specified by:
getTagBrowserin interfaceDesignerContext
-
getOPCBrowser
@NotNull public @NotNull OPCBrowserPanel getOPCBrowser()
Description copied from interface:DesignerContextReturns the OPCBrowserPanel that can be used to browse and import OPC items- Specified by:
getOPCBrowserin interfaceDesignerContext
-
getQueryBrowserPanel
@NotNull public @NotNull QueryBrowser getQueryBrowserPanel()
Description copied from interface:DesignerContextReturns the DB query browser tool- Specified by:
getQueryBrowserPanelin interfaceDesignerContext
-
editResourceDocs
public void editResourceDocs(@NotNull @NotNull ProjectResource resource)Description copied from interface:DesignerContextOpens up the resource notes editor for the given project resources- Specified by:
editResourceDocsin interfaceDesignerContext
-
getDesignerPrefs
@NotNull public @NotNull PersistentProperties getDesignerPrefs()
Description copied from interface:DesignerContextReturns a PersistentProperties file that will be stored on a per-user basis for "persistent" but not project-encapsulated preferences- Specified by:
getDesignerPrefsin interfaceDesignerContext
-
canEditResourceProtection
public boolean canEditResourceProtection()
Description copied from interface:DesignerContextChecks whether or not the current logged in user can edit the protection bits of project resources.- Specified by:
canEditResourceProtectionin interfaceDesignerContext
-
addLegacyScriptNode
public void addLegacyScriptNode()
Adds the Legacy Script project node for pre-7.7 script modules that have been imported by the user.
-
showError
protected void showError(java.lang.String message)
-
showError
protected void showError(java.lang.Exception e)
-
showError
protected void showError(java.lang.String message, java.lang.Exception e)
-
getLogger
protected LoggerEx getLogger()
-
-