public class DesignerContextImpl extends AbstractClientContext implements DesignerContext
| Modifier and Type | Class and Description |
|---|---|
class |
DesignerContextImpl.DesignerProjectHolderImpl |
static class |
DesignerContextImpl.LockInfo |
| Modifier and Type | Field and Description |
|---|---|
protected IgnitionDesigner |
designerGui |
changeSupport, globalProps, log, loggingManager| Constructor and Description |
|---|
DesignerContextImpl(IgnitionDesigner designerGui,
LaunchContext launchContext,
Project userProject,
Project globalProject) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBeanInfoSearchPath(java.lang.String packageName)
Adds the given fully-qualified path name to the Introspector's BeanInfo search path.
|
java.util.UUID |
addFolder(long newResourceId,
java.lang.String moduleId,
int scope,
java.lang.String folderName,
java.util.UUID parent)
Adds a new folder under the given parent.
|
void |
addLegacyScriptNode()
Adds the Legacy Script project node for pre-7.7 script modules that have been imported by the user.
|
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.
|
FunctionFactory |
createExpressionFunctionFactory() |
XMLSerializer |
createSerializer()
Creates a new XML serializer that has been configured by all installed modules for custom serialization delegates
|
void |
deleteResource(long resourceId)
Removes the resource from the current project
|
java.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,
ProjectScope scope)
Opens up the resource notes editor for the given project resources
|
void |
exportResources(java.util.Collection<java.lang.Long> resourceIds,
ProjectScope scope)
Shows the project export window (after doing a commit) with the given resource IDs checked.
|
java.util.Map<java.lang.String,java.lang.String> |
getClientPermissionBundleKeys() |
javax.swing.Action |
getCopyAction() |
javax.swing.Action |
getCutAction() |
javax.swing.Action |
getDeleteAction() |
PersistentProperties |
getDesignerPrefs()
Returns a PersistentProperties file that will be stored on a per-user basis for "persistent" but not
project-encapsulated preferences
|
com.jidesoft.docking.DockingManager |
getDockingManager()
Returns the JIDE DockingManager for the Designer
|
ExecutionManager |
getExecutionManager()
Returns the shared task execution manager for this client
|
java.awt.Frame |
getFrame()
Returns the owning frame of the designer.
|
DesignerContextImpl.DesignerProjectHolderImpl |
getGlobalProject()
Returns the project holder for the global project.
|
LicenseState |
getLicenseState(java.lang.String moduleId)
Returns the license state for the given module
|
DesignerLocalizationManager |
getLocalizationManager() |
ResourceLockManager |
getLockManager()
The resource lock manager that you must use when opening/editing/closing ProjectResources.
|
protected LoggerEx |
getLogger() |
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 context
|
NamedQueryRpc |
getNamedQueryRpc()
Returns the appropriate named query rpc for the context.
|
OPCBrowserPanel |
getOPCBrowser()
Returns the OPCBrowserPanel that can be used to browse and import OPC items
|
javax.swing.Action |
getPasteAction() |
ProjectBrowserRoot |
getProjectBrowserRoot()
Returns the root node of the project browser tree, so that modules may add their own nodes.
|
DesignerContextImpl.DesignerProjectHolderImpl |
getProjectContext()
Returns the designer project holder for the currently opened project.
|
DesignerProjectContext |
getProjectContext(ProjectScope scope)
Provides a way to get the local or global project scope by ProjectScope enum.
|
ProjectVersion |
getProjectVersion()
What version of the project (staging or published) is this client running?
|
protected int |
getProtectionOptionFromDialog() |
QueryBrowser |
getQueryBrowserPanel()
Returns the DB query browser tool
|
java.lang.String |
getResourceCategoryKey(Project project,
ProjectResource resource) |
java.lang.String |
getResourceDisplayName(Project project,
ProjectResource resource) |
javax.swing.Icon |
getResourceIcon(Project project,
ProjectResource resource) |
javax.swing.RootPaneContainer |
getRootPaneContainer()
Returns the RootPaneContainer that is currently the owner of the client
|
ProjectScope |
getScope() |
ScriptManager |
getScriptManager()
Returns the ScriptManager that can be used to execute Python scripts.
|
java.util.List<SearchProvider> |
getSearchProviders() |
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-right
|
TagBrowserPanel |
getTagBrowser()
Returns the TagBrowserPanel that can be used to select Tags
|
TagEditor |
getTagEditor()
Returns the TagEditorPanel that can be used to edit/add Tags
|
ClientTagManager |
getTagManager()
Returns the manager that provides access to Ignition's tag system.
|
com.jidesoft.action.DockableBarManager |
getToolbarManager()
Returns the JIDE dockable toolbar manager
|
DesignerContextImpl.DesignerProjectHolderImpl |
getUserProjectHolder() |
boolean |
hasLock(long resourceId)
Checks to see if the given lock is currently held, which means either:
it has been obtained but not released (it is open)
It has been obtained, modified, and then released, but a save operation has not occurred.
|
boolean |
isLockModified(long resourceId)
Returns true if the lock has been obtained and updated
|
boolean |
isLockOpen(long resourceId)
Returns true if the lock has been obtained and not released
|
void |
moveResource(long resourceId,
java.util.UUID newParent)
Moves the resource to a new parent.
|
long |
newResourceId()
Creates and obtains the lock for a new resource id
|
void |
registerClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)
Register id-bundlekey pairs to limit client permissions
|
void |
registerResourceWorkspace(ResourceWorkspace workspace)
Registers a new
ResourceWorkspace,
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 |
releaseLock(long resourceId)
Designer elements should call this function when they are done with the resource that they obtained a lock for.
|
protected void |
releaseResourceLockFromGateway(long resourceId) |
boolean |
requestLock(long resourceId)
Requests the lock for the given resource.
|
boolean |
requestLockQuietly(long resourceId)
Just like requestLock, except that if the lock isn't obtained, no error message is displayed.
|
protected void |
setResourceLockManager(DesignerContextImpl.DesignerProjectHolderImpl userProject) |
protected void |
showError(java.lang.Exception e) |
protected void |
showError(java.lang.String message) |
protected void |
showError(java.lang.String message,
java.lang.Exception e) |
void |
shutdown() |
void |
structuredRename(long resourceId,
java.lang.String newName)
Attempts to rename the given project resource, respecting the requirement that the name be unique amongst
siblings
(with respect to the folder structure)
|
void |
synchLocks()
Attempts to re-obtain all locks that this resource lock manager currently has.
|
boolean |
updateLock(long resourceId)
Designer elements should call this function when they have actually updated the resource with the given ID.
|
void |
updateResource(long id,
byte[] data)
Convenience call that updates only the serialized bytes of a project resource, leaving all other parameters
intact.
|
void |
updateResource(ProjectResource resource)
Adds or updates the given project resource
|
addProjectChangeListener, addPropertyChangeListener, addPropertyChangeListener, applyDiff, applyGlobalDiff, getAuthProfileName, getCacheDir, getDefaultDatasourceName, getDefaultTagProviderName, getEventBus, getExpressionFunctionFactory, getGlobalProps, getLaunchContext, getLoggingManager, getProgressManager, getProject, getProjectHolder, getTagPollRate, getUIEventBus, removeProjectChangeListener, resetExpressionFunctionFactory, setGlobalProjectHolder, setGlobalProps, setProjectHolder, updateGlobalProps, updateProjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, applyGlobalDiff, getAuthProfileName, getCacheDir, getDefaultDatasourceName, getDefaultTagProviderName, getLaunchContext, getProgressManager, getTagPollRate, getUIEventBusgetEventBus, getExpressionFunctionFactory, getLoggingManageraddProjectChangeListener, applyDiff, getProject, removeProjectChangeListenerprotected IgnitionDesigner designerGui
public DesignerContextImpl(IgnitionDesigner designerGui, LaunchContext launchContext, Project userProject, Project globalProject)
public DesignerContextImpl.DesignerProjectHolderImpl getUserProjectHolder()
protected int getProtectionOptionFromDialog()
protected void setResourceLockManager(DesignerContextImpl.DesignerProjectHolderImpl userProject)
public DesignerLocalizationManager getLocalizationManager()
getLocalizationManager in interface ClientContextgetLocalizationManager in interface DesignerContextpublic NamedQueryRpc getNamedQueryRpc()
ClientContextgetNamedQueryRpc in interface ClientContextpublic DesignerContextImpl.DesignerProjectHolderImpl getProjectContext()
public DesignerContextImpl.DesignerProjectHolderImpl getGlobalProject()
DesignerContextgetGlobalProject in interface ClientContextgetGlobalProject in interface DesignerContextgetGlobalProject in class AbstractClientContextpublic DesignerProjectContext getProjectContext(ProjectScope scope)
DesignerContextgetProjectContext in interface DesignerContextpublic ProjectVersion getProjectVersion()
ClientContextgetProjectVersion in interface ClientContextpublic ExecutionManager getExecutionManager()
ClientContextgetExecutionManager in interface ClientContextpublic java.lang.Object getModule(java.lang.String id)
CommonContextgetModule in interface CommonContextpublic java.util.List<ModuleInfo> getModules()
ClientContextgetModules in interface ClientContextpublic LicenseState getLicenseState(java.lang.String moduleId)
CommonContextgetLicenseState in interface CommonContextpublic void exportResources(java.util.Collection<java.lang.Long> resourceIds,
ProjectScope scope)
DesignerContextexportResources in interface DesignerContextpublic FunctionFactory createExpressionFunctionFactory()
createExpressionFunctionFactory in class AbstractClientContextpublic java.lang.String getResourceCategoryKey(Project project, ProjectResource resource)
public java.lang.String getResourceDisplayName(Project project, ProjectResource resource)
public javax.swing.Icon getResourceIcon(Project project, ProjectResource resource)
public void registerResourceWorkspace(ResourceWorkspace workspace)
DesignerContextResourceWorkspace,
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.registerResourceWorkspace in interface DesignerContextworkspace - The ResourceWorkspace to
register with the designerpublic java.util.List<SearchProvider> getSearchProviders()
getSearchProviders in interface DesignerContextpublic void registerClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)
DesignerContextregisterClientPermissions in interface DesignerContextbundleMap - Map of ids to bundlekeys. May be null.public java.util.Map<java.lang.String,java.lang.String> getClientPermissionBundleKeys()
getClientPermissionBundleKeys in interface DesignerContextpublic void registerSearchProvider(SearchProvider provider)
DesignerContextregisterSearchProvider in interface DesignerContextpublic java.awt.Frame getFrame()
DesignerContextgetFrame in interface DesignerContextpublic javax.swing.Action getCutAction()
getCutAction in interface DesignerContextpublic javax.swing.Action getCopyAction()
getCopyAction in interface DesignerContextpublic javax.swing.Action getPasteAction()
getPasteAction in interface DesignerContextpublic javax.swing.Action getDeleteAction()
getDeleteAction in interface DesignerContextpublic ClientTagManager getTagManager()
CommonContextgetTagManager in interface ClientContextgetTagManager in interface CommonContextpublic void addBeanInfoSearchPath(java.lang.String packageName)
DesignerContextaddBeanInfoSearchPath in interface DesignerContextpublic XMLSerializer createSerializer()
DesignerContextcreateSerializer in interface DesignerContextpublic XMLDeserializer createDeserializer()
CommonContextcreateDeserializer in interface CommonContextpublic StatusBar getStatusBar()
DesignerContextgetStatusBar in interface DesignerContextpublic ResourceLockManager getLockManager()
DesignerContextgetLockManager in interface DesignerContextpublic void shutdown()
public javax.swing.RootPaneContainer getRootPaneContainer()
ClientContextgetRootPaneContainer in interface ClientContextpublic ProjectBrowserRoot getProjectBrowserRoot()
DesignerContextgetProjectBrowserRoot in interface DesignerContextProjectBrowserRoot.getGlobalFolder(),
ProjectBrowserRoot.getProjectFolder(),
AbstractNavTreeNodepublic java.lang.Object deserialize(byte[] data,
org.apache.log4j.Logger log)
throws SerializationException
ClientContextdeserialize in interface ClientContextSerializationExceptionpublic void addPropertyEditor(java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)
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.
addPropertyEditor in interface DesignerContextpublic ScriptManager getScriptManager()
CommonContextgetScriptManager in interface CommonContextpublic com.jidesoft.docking.DockingManager getDockingManager()
DesignerContextgetDockingManager in interface DesignerContextpublic com.jidesoft.action.DockableBarManager getToolbarManager()
DesignerContextgetToolbarManager in interface DesignerContextpublic TagEditor getTagEditor()
DesignerContextgetTagEditor in interface DesignerContextpublic TagBrowserPanel getTagBrowser()
DesignerContextgetTagBrowser in interface DesignerContextpublic OPCBrowserPanel getOPCBrowser()
DesignerContextgetOPCBrowser in interface DesignerContextpublic QueryBrowser getQueryBrowserPanel()
DesignerContextgetQueryBrowserPanel in interface DesignerContextpublic void editResourceDocs(ProjectResource resource, ProjectScope scope)
DesignerContexteditResourceDocs in interface DesignerContextpublic PersistentProperties getDesignerPrefs()
DesignerContextgetDesignerPrefs in interface DesignerContextpublic void deleteResource(long resourceId)
DesignerProjectContextdeleteResource in interface DesignerProjectContextpublic void updateResource(long id,
byte[] data)
DesignerProjectContextupdateResource in interface DesignerProjectContextpublic void updateResource(ProjectResource resource)
DesignerProjectContextupdateResource in interface DesignerProjectContextpublic void structuredRename(long resourceId,
java.lang.String newName)
throws java.lang.IllegalArgumentException
DesignerProjectContextstructuredRename in interface DesignerProjectContextresourceId - The ID of the resource to renamenewName - The new namejava.lang.IllegalArgumentException - Thrown when the name is not unique.public void moveResource(long resourceId,
java.util.UUID newParent)
DesignerProjectContextmoveResource in interface DesignerProjectContextpublic java.util.UUID addFolder(long newResourceId,
java.lang.String moduleId,
int scope,
java.lang.String folderName,
java.util.UUID parent)
DesignerProjectContextaddFolder in interface DesignerProjectContextpublic long newResourceId()
throws java.lang.Exception
ResourceLockManagernewResourceId in interface ResourceLockManagerjava.lang.Exceptionpublic ProjectScope getScope()
getScope in interface DesignerProjectContextpublic boolean updateLock(long resourceId)
ResourceLockManagerupdateLock in interface ResourceLockManagerpublic boolean hasLock(long resourceId)
ResourceLockManagerhasLock in interface ResourceLockManagerpublic boolean isLockModified(long resourceId)
ResourceLockManagerisLockModified in interface ResourceLockManagerpublic boolean isLockOpen(long resourceId)
ResourceLockManagerisLockOpen in interface ResourceLockManagerpublic void releaseLock(long resourceId)
ResourceLockManagerreleaseLock in interface ResourceLockManagerpublic void synchLocks()
ResourceLockManagersynchLocks in interface ResourceLockManagerpublic boolean requestLock(long resourceId)
ResourceLockManagerrequestLock in interface ResourceLockManagerpublic boolean requestLockQuietly(long resourceId)
ResourceLockManagerrequestLockQuietly in interface ResourceLockManagerpublic boolean canEditResourceProtection()
throws GatewayException
DesignerProjectContextcanEditResourceProtection in interface DesignerProjectContextGatewayExceptionprotected void showError(java.lang.String message)
protected void showError(java.lang.Exception e)
protected void showError(java.lang.String message,
java.lang.Exception e)
protected void releaseResourceLockFromGateway(long resourceId)
throws java.lang.Exception
java.lang.Exceptionprotected LoggerEx getLogger()
public void addLegacyScriptNode()