Class DesignerContextProxy
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.DesignerContextProxy
-
- All Implemented Interfaces:
ClientContext
,CommonContext
,DesignerContext
public class DesignerContextProxy extends java.lang.Object implements DesignerContext
This is used for parts of the designer that hold onto a DesignerContext, even though every time you load a project a new designer context is made. So, this context can be permanent, and we just switch out the inner context delegate.
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.designer.model.DesignerContext
SCRIPT_MANAGER_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description DesignerContextProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBeanInfoSearchPath(java.lang.String packageName)
Adds the given fully-qualified path name to the Introspector's BeanInfo search path.void
addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
void
addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener pcl)
void
addPropertyEditor(java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)
Adds a property editor page that will be incorporated into the Designer's project property editing system.boolean
canEditResourceProtection()
Checks whether or not the current logged in user can edit the protection bits of project resources.XMLDeserializer
createDeserializer()
Returns an instance of the XMLDeserializer that can be used to deserialize project resources.XMLSerializer
createSerializer()
Creates a new XML serializer that has been configured by all installed modules for custom serialization delegatesjava.lang.Object
deserialize(byte[] data, org.apache.log4j.Logger log)
Convenience function to deserialize a gzipped byte array into a single object.void
editResourceDocs(ProjectResource resource)
Opens up the resource notes editor for the given project resourcesvoid
exportResources(java.util.Collection<ResourcePath> resourceIds)
Shows the project export window (after doing a commit) with the given resource IDs checked.java.lang.String
getAuthProfileName()
Returns the current project's user sourcejava.util.Map<java.lang.String,java.lang.String>
getClientPermissionBundleKeys()
DesignerContext
getContext()
javax.swing.Action
getCopyAction()
javax.swing.Action
getCutAction()
java.lang.String
getDefaultDatasourceName()
Returns the current project's default datasource namejava.lang.String
getDefaultTagProviderName()
Returns the current project's default Tag providerjavax.swing.Action
getDeleteAction()
PersistentProperties
getDesignerPrefs()
Returns a PersistentProperties file that will be stored on a per-user basis for "persistent" but not project-encapsulated preferencescom.jidesoft.docking.DockingManager
getDockingManager()
Returns the JIDE DockingManager for the Designerjava.util.List<EdgeEdition>
getEdgeEditions()
Returns a list of currently available Edge editions (either licensed or in trial).com.google.common.eventbus.EventBus
getEventBus()
This is a generic event bus that can be used by any part of Ignition within a single scope (jvm)ExecutionManager
getExecutionManager()
Returns the shared task execution manager for this clientFunctionFactory
getExpressionFunctionFactory()
Returns the core function factory used by expressions.java.awt.Frame
getFrame()
Returns the owning frame of the designer.LaunchContext
getLaunchContext()
LicenseState
getLicenseState(java.lang.String moduleId)
Returns the license state for the given moduleDesignerLocalizationManager
getLocalizationManager()
LogFilterSettings
getLoggingManager()
java.lang.Object
getModule(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 contextNamedQueryManager
getNamedQueryManager()
Returns the appropriate named query rpc for the context.OPCBrowserPanel
getOPCBrowser()
Returns the OPCBrowserPanel that can be used to browse and import OPC itemsjavax.swing.Action
getPasteAction()
ClientProgressManager
getProgressManager()
Returns the progress manager, which allows the execution of long running or async tasks.DesignableProject
getProject()
Returns the project that this client is running.ProjectBrowserRoot
getProjectBrowserRoot()
Returns the root node of the project browser tree, so that modules may add their own nodes.java.lang.String
getProjectName()
The name of the project this client will be / is runningQueryBrowser
getQueryBrowserPanel()
Returns the DB query browser toolDesignerResourceEditManager
getResourceEditManager()
Resource edit managerjavax.swing.RootPaneContainer
getRootPaneContainer()
Returns the RootPaneContainer that is currently the owner of the clientScriptManager
getScriptManager()
Returns the ScriptManager that can be used to execute Python scripts.java.util.List<SearchProvider>
getSearchProviders()
Get the registered SearchProviders.StatusBar
getStatusBar()
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-rightcom.inductiveautomation.ignition.designer.tags.frame.TagBrowserFrame
getTagBrowser()
Returns the TagBrowserPanel that can be used to select TagsTagEditor
getTagEditor()
Returns the TagEditorPanel that can be used to edit/add TagsClientTagManager
getTagManager()
Returns the manager that provides access to Ignition's tag system.int
getTagPollRate()
Returns the rate at which Tags should be polled for updatescom.jidesoft.action.DockableBarManager
getToolbarManager()
Returns the JIDE dockable toolbar managercom.google.common.eventbus.EventBus
getUIEventBus()
This event bus schedules event notification on the swing EDT.void
registerClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)
Register id-bundlekey pairs to limit client permissionsvoid
registerResourceWorkspace(ResourceWorkspace workspace)
Registers a newResourceWorkspace
, which is a main editing area for the designer.void
registerSearchProvider(SearchProvider provider)
Registers a search provider that will be exposed through the find/replace system.void
setContext(DesignerContext context)
-
-
-
Method Detail
-
getContext
public DesignerContext getContext()
-
setContext
public void setContext(DesignerContext context)
-
getProjectName
@Nonnull public java.lang.String getProjectName()
Description copied from interface:ClientContext
The name of the project this client will be / is running- Specified by:
getProjectName
in interfaceClientContext
-
getLoggingManager
public LogFilterSettings getLoggingManager()
- Specified by:
getLoggingManager
in interfaceCommonContext
-
getEventBus
public com.google.common.eventbus.EventBus getEventBus()
Description copied from interface:CommonContext
This is a generic event bus that can be used by any part of Ignition within a single scope (jvm)- Specified by:
getEventBus
in interfaceCommonContext
-
getUIEventBus
public com.google.common.eventbus.EventBus getUIEventBus()
Description copied from interface:ClientContext
This event bus schedules event notification on the swing EDT. This is opposed to the event bus found onCommonContext.getEventBus()
, which schedules event notification on a background thread.- Specified by:
getUIEventBus
in interfaceClientContext
-
getNamedQueryManager
public NamedQueryManager getNamedQueryManager()
Description copied from interface:ClientContext
Returns 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:
getNamedQueryManager
in interfaceClientContext
- Returns:
- The correct NamedQueryManager implementation for the scope.
-
getExpressionFunctionFactory
public FunctionFactory getExpressionFunctionFactory()
Description copied from interface:CommonContext
Returns the core function factory used by expressions. Includes extension functions registered by modules.- Specified by:
getExpressionFunctionFactory
in interfaceCommonContext
-
getLocalizationManager
public DesignerLocalizationManager getLocalizationManager()
- Specified by:
getLocalizationManager
in interfaceClientContext
- Specified by:
getLocalizationManager
in interfaceDesignerContext
-
getLaunchContext
public LaunchContext getLaunchContext()
- Specified by:
getLaunchContext
in interfaceClientContext
-
addBeanInfoSearchPath
public void addBeanInfoSearchPath(java.lang.String packageName)
Description copied from interface:DesignerContext
Adds 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:
addBeanInfoSearchPath
in interfaceDesignerContext
- Parameters:
packageName
- fully-qualified path name. Not null.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
- Specified by:
addPropertyChangeListener
in interfaceClientContext
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener pcl)
- Specified by:
addPropertyChangeListener
in interfaceClientContext
-
exportResources
public void exportResources(java.util.Collection<ResourcePath> resourceIds)
Description copied from interface:DesignerContext
Shows the project export window (after doing a commit) with the given resource IDs checked.- Specified by:
exportResources
in interfaceDesignerContext
- Parameters:
resourceIds
- Collection of ProjectResourceIds. Not null, but may be empty.
-
getExecutionManager
public ExecutionManager getExecutionManager()
Description copied from interface:ClientContext
Returns the shared task execution manager for this client- Specified by:
getExecutionManager
in interfaceClientContext
-
getProgressManager
public ClientProgressManager getProgressManager()
Description copied from interface:ClientContext
Returns the progress manager, which allows the execution of long running or async tasks.- Specified by:
getProgressManager
in interfaceClientContext
-
createSerializer
public XMLSerializer createSerializer()
Description copied from interface:DesignerContext
Creates a new XML serializer that has been configured by all installed modules for custom serialization delegates- Specified by:
createSerializer
in interfaceDesignerContext
- Returns:
- Not null.
-
getDesignerPrefs
public PersistentProperties getDesignerPrefs()
Description copied from interface:DesignerContext
Returns a PersistentProperties file that will be stored on a per-user basis for "persistent" but not project-encapsulated preferences- Specified by:
getDesignerPrefs
in interfaceDesignerContext
-
getDefaultDatasourceName
public java.lang.String getDefaultDatasourceName()
Description copied from interface:ClientContext
Returns the current project's default datasource name- Specified by:
getDefaultDatasourceName
in interfaceClientContext
-
getDefaultTagProviderName
public java.lang.String getDefaultTagProviderName()
Description copied from interface:ClientContext
Returns the current project's default Tag provider- Specified by:
getDefaultTagProviderName
in interfaceClientContext
-
getAuthProfileName
public java.lang.String getAuthProfileName()
Description copied from interface:ClientContext
Returns the current project's user source- Specified by:
getAuthProfileName
in interfaceClientContext
-
getSearchProviders
public java.util.List<SearchProvider> getSearchProviders()
Description copied from interface:DesignerContext
Get the registered SearchProviders.- Specified by:
getSearchProviders
in interfaceDesignerContext
- Returns:
- Not null.
-
registerClientPermissions
public void registerClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)
Description copied from interface:DesignerContext
Register id-bundlekey pairs to limit client permissions- Specified by:
registerClientPermissions
in interfaceDesignerContext
- Parameters:
bundleMap
- Map of ids to bundlekeys. Not null.
-
getClientPermissionBundleKeys
public java.util.Map<java.lang.String,java.lang.String> getClientPermissionBundleKeys()
- Specified by:
getClientPermissionBundleKeys
in interfaceDesignerContext
-
canEditResourceProtection
public boolean canEditResourceProtection()
Description copied from interface:DesignerContext
Checks whether or not the current logged in user can edit the protection bits of project resources.- Specified by:
canEditResourceProtection
in interfaceDesignerContext
-
registerSearchProvider
public void registerSearchProvider(SearchProvider provider)
Description copied from interface:DesignerContext
Registers a search provider that will be exposed through the find/replace system.- Specified by:
registerSearchProvider
in interfaceDesignerContext
-
getFrame
public java.awt.Frame getFrame()
Description copied from interface:DesignerContext
Returns the owning frame of the designer. Handy for dialog parents- Specified by:
getFrame
in interfaceDesignerContext
-
getCopyAction
public javax.swing.Action getCopyAction()
- Specified by:
getCopyAction
in interfaceDesignerContext
-
getCutAction
public javax.swing.Action getCutAction()
- Specified by:
getCutAction
in interfaceDesignerContext
-
getDeleteAction
public javax.swing.Action getDeleteAction()
- Specified by:
getDeleteAction
in interfaceDesignerContext
-
getPasteAction
public javax.swing.Action getPasteAction()
- Specified by:
getPasteAction
in interfaceDesignerContext
-
getRootPaneContainer
public javax.swing.RootPaneContainer getRootPaneContainer()
Description copied from interface:ClientContext
Returns the RootPaneContainer that is currently the owner of the client- Specified by:
getRootPaneContainer
in interfaceClientContext
-
getTagPollRate
public int getTagPollRate()
Description copied from interface:ClientContext
Returns the rate at which Tags should be polled for updates- Specified by:
getTagPollRate
in interfaceClientContext
-
getStatusBar
public StatusBar getStatusBar()
Description copied from interface:DesignerContext
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- Specified by:
getStatusBar
in interfaceDesignerContext
- Returns:
- Not null.
-
getResourceEditManager
public DesignerResourceEditManager getResourceEditManager()
Description copied from interface:DesignerContext
Resource edit manager- Specified by:
getResourceEditManager
in interfaceDesignerContext
-
getTagManager
public ClientTagManager getTagManager()
Description copied from interface:CommonContext
Returns the manager that provides access to Ignition's tag system.- Specified by:
getTagManager
in interfaceClientContext
- Specified by:
getTagManager
in interfaceCommonContext
-
registerResourceWorkspace
public void registerResourceWorkspace(ResourceWorkspace workspace)
Description copied from interface:DesignerContext
Registers 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:
registerResourceWorkspace
in interfaceDesignerContext
- Parameters:
workspace
- TheResourceWorkspace
to register with the designer
-
createDeserializer
public XMLDeserializer createDeserializer()
Description copied from interface:CommonContext
Returns 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:
createDeserializer
in interfaceCommonContext
-
getProjectBrowserRoot
public ProjectBrowserRoot getProjectBrowserRoot()
Description copied from interface:DesignerContext
Returns the root node of the project browser tree, so that modules may add their own nodes.- Specified by:
getProjectBrowserRoot
in interfaceDesignerContext
- See Also:
AbstractNavTreeNode
-
deserialize
public java.lang.Object deserialize(byte[] data, org.apache.log4j.Logger log) throws SerializationException
Description copied from interface:ClientContext
Convenience 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:
deserialize
in interfaceClientContext
- Throws:
SerializationException
-
addPropertyEditor
public void addPropertyEditor(java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)
Description copied from interface:DesignerContext
Adds 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:
addPropertyEditor
in interfaceDesignerContext
-
getScriptManager
public ScriptManager getScriptManager()
Description copied from interface:CommonContext
Returns the ScriptManager that can be used to execute Python scripts.- Specified by:
getScriptManager
in interfaceCommonContext
-
getDockingManager
public com.jidesoft.docking.DockingManager getDockingManager()
Description copied from interface:DesignerContext
Returns the JIDE DockingManager for the Designer- Specified by:
getDockingManager
in interfaceDesignerContext
-
getToolbarManager
public com.jidesoft.action.DockableBarManager getToolbarManager()
Description copied from interface:DesignerContext
Returns the JIDE dockable toolbar manager- Specified by:
getToolbarManager
in interfaceDesignerContext
-
getTagBrowser
public com.inductiveautomation.ignition.designer.tags.frame.TagBrowserFrame getTagBrowser()
Description copied from interface:DesignerContext
Returns the TagBrowserPanel that can be used to select Tags- Specified by:
getTagBrowser
in interfaceDesignerContext
-
getOPCBrowser
public OPCBrowserPanel getOPCBrowser()
Description copied from interface:DesignerContext
Returns the OPCBrowserPanel that can be used to browse and import OPC items- Specified by:
getOPCBrowser
in interfaceDesignerContext
-
getTagEditor
public TagEditor getTagEditor()
Description copied from interface:DesignerContext
Returns the TagEditorPanel that can be used to edit/add Tags- Specified by:
getTagEditor
in interfaceDesignerContext
-
getQueryBrowserPanel
public QueryBrowser getQueryBrowserPanel()
Description copied from interface:DesignerContext
Returns the DB query browser tool- Specified by:
getQueryBrowserPanel
in interfaceDesignerContext
-
getProject
public DesignableProject getProject()
Description copied from interface:ClientContext
Returns the project that this client is running. Note that this may be null before the client is fully logged in and started, because the context is created before the project is downloaded.- Specified by:
getProject
in interfaceClientContext
- Specified by:
getProject
in interfaceDesignerContext
-
getModule
public java.lang.Object getModule(java.lang.String id)
Description copied from interface:CommonContext
Returns 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:
getModule
in interfaceCommonContext
-
getModules
public java.util.List<ModuleInfo> getModules()
Description copied from interface:ClientContext
Retrieve the list of all modules currently loaded in this context- Specified by:
getModules
in interfaceClientContext
-
editResourceDocs
public void editResourceDocs(ProjectResource resource)
Description copied from interface:DesignerContext
Opens up the resource notes editor for the given project resources- Specified by:
editResourceDocs
in interfaceDesignerContext
-
getLicenseState
public LicenseState getLicenseState(java.lang.String moduleId)
Description copied from interface:CommonContext
Returns the license state for the given module- Specified by:
getLicenseState
in interfaceCommonContext
-
getEdgeEditions
public java.util.List<EdgeEdition> getEdgeEditions()
Description copied from interface:CommonContext
Returns a list of currently available Edge editions (either licensed or in trial). Does not check if any required modules are installed and running.- Specified by:
getEdgeEditions
in interfaceCommonContext
-
-