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() |
SQLTagTreeModel |
getSQLTagTreeModel() |
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 SQLTags
|
TagEditor |
getTagEditor()
Returns the TagEditorPanel that can be used to edit/add SQLTags
|
ClientTagManager |
getTagManager()
Returns the TagManager that can be used to read,write,browse, and subscribe to SQLTags from this context.
|
TagUtilities |
getTagUtilities()
A class that has some handy functions for dealing with SQLTags
|
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, getDefaultSQLTagsProviderName, getEventBus, getExpressionFunctionFactory, getGlobalProps, getLaunchContext, getLoggingManager, getProgressManager, getProject, getTagPollRate, getUIEventBus, ph, removeProjectChangeListener, resetExpressionFunctionFactory, setGlobalProjectHolder, setGlobalProps, setProjectHolder, updateGlobalProps, updateProject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, applyGlobalDiff, getAuthProfileName, getCacheDir, getDefaultDatasourceName, getDefaultSQLTagsProviderName, getLaunchContext, getProgressManager, getTagPollRate, getUIEventBus
getEventBus, getExpressionFunctionFactory, getLoggingManager
addProjectChangeListener, applyDiff, getProject, removeProjectChangeListener
protected 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 ClientContext
getLocalizationManager
in interface DesignerContext
public NamedQueryRpc getNamedQueryRpc()
ClientContext
getNamedQueryRpc
in interface ClientContext
public DesignerContextImpl.DesignerProjectHolderImpl getProjectContext()
public DesignerContextImpl.DesignerProjectHolderImpl getGlobalProject()
DesignerContext
getGlobalProject
in interface ClientContext
getGlobalProject
in interface DesignerContext
getGlobalProject
in class AbstractClientContext
public DesignerProjectContext getProjectContext(ProjectScope scope)
DesignerContext
getProjectContext
in interface DesignerContext
public ProjectVersion getProjectVersion()
ClientContext
getProjectVersion
in interface ClientContext
public ExecutionManager getExecutionManager()
ClientContext
getExecutionManager
in interface ClientContext
public java.lang.Object getModule(java.lang.String id)
BaseContext
getModule
in interface BaseContext
public java.util.List<ModuleInfo> getModules()
ClientContext
getModules
in interface ClientContext
public LicenseState getLicenseState(java.lang.String moduleId)
BaseContext
getLicenseState
in interface BaseContext
public void exportResources(java.util.Collection<java.lang.Long> resourceIds, ProjectScope scope)
DesignerContext
exportResources
in interface DesignerContext
public FunctionFactory createExpressionFunctionFactory()
createExpressionFunctionFactory
in class AbstractClientContext
public 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)
DesignerContext
ResourceWorkspace
, 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 DesignerContext
workspace
- The
ResourceWorkspace
to register with the designerpublic java.util.List<SearchProvider> getSearchProviders()
getSearchProviders
in interface DesignerContext
public void registerClientPermissions(java.util.Map<java.lang.String,java.lang.String> bundleMap)
DesignerContext
registerClientPermissions
in interface DesignerContext
bundleMap
- Map of ids to bundlekeys. May be null.public java.util.Map<java.lang.String,java.lang.String> getClientPermissionBundleKeys()
getClientPermissionBundleKeys
in interface DesignerContext
public void registerSearchProvider(SearchProvider provider)
DesignerContext
registerSearchProvider
in interface DesignerContext
public java.awt.Frame getFrame()
DesignerContext
getFrame
in interface DesignerContext
public javax.swing.Action getCutAction()
getCutAction
in interface DesignerContext
public javax.swing.Action getCopyAction()
getCopyAction
in interface DesignerContext
public javax.swing.Action getPasteAction()
getPasteAction
in interface DesignerContext
public javax.swing.Action getDeleteAction()
getDeleteAction
in interface DesignerContext
public ClientTagManager getTagManager()
BaseContext
getTagManager
in interface ClientContext
getTagManager
in interface BaseContext
public SQLTagTreeModel getSQLTagTreeModel()
getSQLTagTreeModel
in interface DesignerContext
public void addBeanInfoSearchPath(java.lang.String packageName)
DesignerContext
addBeanInfoSearchPath
in interface DesignerContext
public XMLSerializer createSerializer()
DesignerContext
createSerializer
in interface DesignerContext
public XMLDeserializer createDeserializer()
BaseContext
createDeserializer
in interface BaseContext
public StatusBar getStatusBar()
DesignerContext
getStatusBar
in interface DesignerContext
public ResourceLockManager getLockManager()
DesignerContext
getLockManager
in interface DesignerContext
public void shutdown()
public javax.swing.RootPaneContainer getRootPaneContainer()
ClientContext
getRootPaneContainer
in interface ClientContext
public ProjectBrowserRoot getProjectBrowserRoot()
DesignerContext
getProjectBrowserRoot
in interface DesignerContext
ProjectBrowserRoot.getGlobalFolder()
,
ProjectBrowserRoot.getProjectFolder();
,
AbstractNavTreeNode
public java.lang.Object deserialize(byte[] data, org.apache.log4j.Logger log) throws SerializationException
ClientContext
deserialize
in interface ClientContext
SerializationException
public void addPropertyEditor(java.lang.Class<? extends AbstractPropertyEditorPanel> pageClass)
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.
addPropertyEditor
in interface DesignerContext
public ScriptManager getScriptManager()
BaseContext
getScriptManager
in interface BaseContext
public com.jidesoft.docking.DockingManager getDockingManager()
DesignerContext
getDockingManager
in interface DesignerContext
public com.jidesoft.action.DockableBarManager getToolbarManager()
DesignerContext
getToolbarManager
in interface DesignerContext
public TagEditor getTagEditor()
DesignerContext
getTagEditor
in interface DesignerContext
public TagBrowserPanel getTagBrowser()
DesignerContext
getTagBrowser
in interface DesignerContext
public OPCBrowserPanel getOPCBrowser()
DesignerContext
getOPCBrowser
in interface DesignerContext
public QueryBrowser getQueryBrowserPanel()
DesignerContext
getQueryBrowserPanel
in interface DesignerContext
public TagUtilities getTagUtilities()
DesignerContext
getTagUtilities
in interface DesignerContext
public void editResourceDocs(ProjectResource resource, ProjectScope scope)
DesignerContext
editResourceDocs
in interface DesignerContext
public PersistentProperties getDesignerPrefs()
DesignerContext
getDesignerPrefs
in interface DesignerContext
public void deleteResource(long resourceId)
DesignerProjectContext
deleteResource
in interface DesignerProjectContext
public void updateResource(long id, byte[] data)
DesignerProjectContext
updateResource
in interface DesignerProjectContext
public void updateResource(ProjectResource resource)
DesignerProjectContext
updateResource
in interface DesignerProjectContext
public void structuredRename(long resourceId, java.lang.String newName) throws java.lang.IllegalArgumentException
DesignerProjectContext
structuredRename
in interface DesignerProjectContext
resourceId
- 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)
DesignerProjectContext
moveResource
in interface DesignerProjectContext
public java.util.UUID addFolder(long newResourceId, java.lang.String moduleId, int scope, java.lang.String folderName, java.util.UUID parent)
DesignerProjectContext
addFolder
in interface DesignerProjectContext
public long newResourceId() throws java.lang.Exception
ResourceLockManager
newResourceId
in interface ResourceLockManager
java.lang.Exception
public ProjectScope getScope()
getScope
in interface DesignerProjectContext
public boolean updateLock(long resourceId)
ResourceLockManager
updateLock
in interface ResourceLockManager
public boolean hasLock(long resourceId)
ResourceLockManager
hasLock
in interface ResourceLockManager
public boolean isLockModified(long resourceId)
ResourceLockManager
isLockModified
in interface ResourceLockManager
public boolean isLockOpen(long resourceId)
ResourceLockManager
isLockOpen
in interface ResourceLockManager
public void releaseLock(long resourceId)
ResourceLockManager
releaseLock
in interface ResourceLockManager
public void synchLocks()
ResourceLockManager
synchLocks
in interface ResourceLockManager
public boolean requestLock(long resourceId)
ResourceLockManager
requestLock
in interface ResourceLockManager
public boolean requestLockQuietly(long resourceId)
ResourceLockManager
requestLockQuietly
in interface ResourceLockManager
public boolean canEditResourceProtection() throws GatewayException
DesignerProjectContext
canEditResourceProtection
in interface DesignerProjectContext
GatewayException
protected 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.Exception
protected LoggerEx getLogger()
public void addLegacyScriptNode()