Class DesignerProjectTreeImpl
- java.lang.Object
- 
- com.inductiveautomation.ignition.common.project.AbstractProject
- 
- com.inductiveautomation.ignition.designer.project.DesignerProjectTreeImpl
 
 
- 
- All Implemented Interfaces:
- Project,- DesignableProject,- java.io.Serializable
 
 public class DesignerProjectTreeImpl extends AbstractProject implements DesignableProject - See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from interface com.inductiveautomation.ignition.common.project.ProjectGLOBAL_PROJECT_NAME, PIPELINE_PROJECT_NAME, PROJECT_NAME_PATTERN, SFC_PROJECT_NAME
 
- 
 - 
Constructor SummaryConstructors Constructor Description DesignerProjectTreeImpl(Project project)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyChange(ProjectChange change)Apply a set of changes, pulled from the gateway, to this project.java.util.Optional<java.util.List<ProjectResource>>browse(ResourcePath path)voidcreateResource(ProjectResource resource)Create a new resource.voiddeleteResource(ResourcePath path)Delete the resource at a given path.booleandiscardChanges(ResourcePath path)Discards any local changes for a path.java.util.Map<ProjectResourceId,ProjectResource>getAllResources()Get a List of all resources in this project and all parent projects.java.util.List<ChangeOperation>getChanges()java.util.Collection<ChangeOperation>getConflicts(java.util.Collection<ChangeOperation> changes)java.lang.StringgetDefiningProject(ResourcePath path)Return the project name where the given ResourcePath is actually defined.ProjectManifestgetManifest()Get theProjectManifestfor this Project.java.lang.StringgetName()java.util.List<NamedManifest>getProjectInheritanceStructure()java.util.List<ProjectSnapshot>getProjectSnapshots()Gets the snapshots from the effective project, in order of project inheritance (leaf project last)java.util.Optional<ProjectResource>getResource(ResourcePath path)Finds the resource at the given path, using an effective view of the resources in this project chain.booleanisChanged(ResourcePath path)booleanisConflict(ResourcePath path)booleanisInherited(ResourcePath path)booleanisLocal(ResourcePath path)booleanisOverridable(ResourcePath path)booleanisOverridden(ResourcePath path)voidmodifyResource(ProjectResource resource)Modify an existing resource.voidnotifyPushComplete(java.util.List<ChangeOperation> changesPushed)Notify that a push was completed.voidremoveAllProjectResourceListeners()Removes allProjectResourceListeners.voidrenameResource(ResourcePath sourcePath, java.lang.String newName)Rename a resource at the given path.protected ProjectDiff.EffectiveDiffupdateEffectiveState()Call this after one or more resources or manifests have been changed.- 
Methods inherited from class com.inductiveautomation.ignition.common.project.AbstractProjectaddProjectResourceListener, getEffectiveResources, getListeners, getResources, getResourcesOfType, hasResourcesOfType, removeProjectResourceListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.inductiveautomation.ignition.designer.project.DesignableProjectcreateOrModify, createOrModify, createResourceSafe, createResourceSafe, deleteResource, getLocalResource, getLocalResource, modifyResource, modifyResourceIfLocal, renameResource
 - 
Methods inherited from interface com.inductiveautomation.ignition.common.project.ProjectaddProjectResourceListener, getDescription, getParent, getResource, getResources, getResourcesOfType, getSingletonResource, getTitle, hasResourcesOfType, isEnabled, isInheritable, isRunnable, removeProjectResourceListener
 
- 
 
- 
- 
- 
Constructor Detail- 
DesignerProjectTreeImplpublic DesignerProjectTreeImpl(Project project) 
 
- 
 - 
Method Detail- 
updateEffectiveStateprotected ProjectDiff.EffectiveDiff updateEffectiveState() Description copied from class:AbstractProjectCall this after one or more resources or manifests have been changed. This will calculate the effective change to the resources and notify listeners.- Overrides:
- updateEffectiveStatein class- AbstractProject
 
 - 
getResourcepublic java.util.Optional<ProjectResource> getResource(ResourcePath path) Description copied from interface:ProjectFinds the resource at the given path, using an effective view of the resources in this project chain.- Specified by:
- getResourcein interface- Project
- Parameters:
- path- Not null
- Returns:
- The matching project resource or empty if not found.
 
 - 
browsepublic java.util.Optional<java.util.List<ProjectResource>> browse(@Nonnull ResourcePath path) 
 - 
modifyResourcepublic void modifyResource(ProjectResource resource) throws ResourceNotFoundException Description copied from interface:DesignableProjectModify an existing resource. Must already exist as a local resource, otherwise this will throw anResourceNotFoundException- Specified by:
- modifyResourcein interface- DesignableProject
- Throws:
- ResourceNotFoundException
 
 - 
createResourcepublic void createResource(ProjectResource resource) throws ResourceNamingException Description copied from interface:DesignableProjectCreate a new resource.Will also create any folders needed along the new resource's path. - Specified by:
- createResourcein interface- DesignableProject
- Throws:
- NameInUseException- if the resource's name is is already in use by a local sibling.
- ResourceNamingException
 
 - 
deleteResourcepublic void deleteResource(ResourcePath path) throws ResourceNotFoundException Description copied from interface:DesignableProjectDelete the resource at a given path.- Specified by:
- deleteResourcein interface- DesignableProject
- Throws:
- ResourceNotFoundException
 
 - 
renameResourcepublic void renameResource(ResourcePath sourcePath, java.lang.String newName) throws ResourceNamingException Description copied from interface:DesignableProjectRename a resource at the given path.- Specified by:
- renameResourcein interface- DesignableProject
- Throws:
- ResourceNamingException
 
 - 
discardChangespublic boolean discardChanges(ResourcePath path) Description copied from interface:DesignableProjectDiscards any local changes for a path.- Specified by:
- discardChangesin interface- DesignableProject
- Returns:
- true if there were changes to discard, false if there were no changes in the first place.
 
 - 
isLocalpublic boolean isLocal(ResourcePath path) - Specified by:
- isLocalin interface- DesignableProject
- Returns:
- True if there is a project resource at the given path that defined in the local project.
 
 - 
isChangedpublic boolean isChanged(ResourcePath path) - Specified by:
- isChangedin interface- DesignableProject
- Returns:
- True if there is a resource at the given path that has been locally altered.
 
 - 
isInheritedpublic boolean isInherited(ResourcePath path) - Specified by:
- isInheritedin interface- DesignableProject
- Returns:
- True if there is a resource at the given path that is inherited from a parent project
 
 - 
isOverridablepublic boolean isOverridable(ResourcePath path) - Specified by:
- isOverridablein interface- DesignableProject
- Returns:
- False if there is an inherited resource that does not allow overrides. True otherwise.
 
 - 
isOverriddenpublic boolean isOverridden(ResourcePath path) - Specified by:
- isOverriddenin interface- DesignableProject
- Returns:
- True if there is a resource at the given path defined in this project that is overriding a resource from a parent project at the same path.
 
 - 
isConflictpublic boolean isConflict(ResourcePath path) - Specified by:
- isConflictin interface- DesignableProject
- Returns:
- True if there is a resource with a conflicting (but differently cased) name at the given path - see
 NameCollisionException
 
 - 
getDefiningProjectpublic java.lang.String getDefiningProject(ResourcePath path) Description copied from interface:DesignableProjectReturn the project name where the given ResourcePath is actually defined.- Specified by:
- getDefiningProjectin interface- DesignableProject
 
 - 
getNamepublic java.lang.String getName() 
 - 
getManifestpublic ProjectManifest getManifest() Description copied from interface:ProjectGet theProjectManifestfor this Project.- Specified by:
- getManifestin interface- Project
- Returns:
- the ProjectManifestfor this Project.
 
 - 
getProjectInheritanceStructurepublic java.util.List<NamedManifest> getProjectInheritanceStructure() - Specified by:
- getProjectInheritanceStructurein interface- Project
- Returns:
- A list of all of the projects and their manifests that comprise the inheritance chain of this project. This list is ordered in ascending inheritance order, from leaf project first to super-most project last.
 
 - 
getAllResourcespublic java.util.Map<ProjectResourceId,ProjectResource> getAllResources() Description copied from interface:ProjectGet a List of all resources in this project and all parent projects.This includes resources belonging to parent projects in the inheritance chain if this is a "stack" of projects. This means that there may be multiple resources for any given ResourcePath.This project instance may not contain all resources that exist for the project on disk, depending on the ResourceFilterused to load it.- Specified by:
- getAllResourcesin interface- Project
- Returns:
- all the resources belonging to this project instance, including resources from parent projects.
 
 - 
getProjectSnapshotspublic java.util.List<ProjectSnapshot> getProjectSnapshots() Description copied from interface:ProjectGets the snapshots from the effective project, in order of project inheritance (leaf project last)- Specified by:
- getProjectSnapshotsin interface- Project
- Returns:
- A list of ProjectSnapshots, one per project represented in the effective project.
 
 - 
getChangespublic java.util.List<ChangeOperation> getChanges() - Specified by:
- getChangesin interface- DesignableProject
- Returns:
- The change operations that have occurred on this project since loaded or since the last applyChanges
 
 - 
getConflictspublic java.util.Collection<ChangeOperation> getConflicts(java.util.Collection<ChangeOperation> changes) - Specified by:
- getConflictsin interface- DesignableProject
- Parameters:
- changes- Diff operations applicable to the local project
- Returns:
- a collection of the change operations that conflict with local changes
 
 - 
applyChangepublic void applyChange(ProjectChange change) throws NameCollisionException Apply a set of changes, pulled from the gateway, to this project. For local resources, this will update the "local" reference of the ResourceTreeNode so that further calls to get snapshots will reflect these changes.- Parameters:
- change- The change collection to apply.
- Throws:
- NameCollisionException
 
 - 
notifyPushCompletepublic void notifyPushComplete(java.util.List<ChangeOperation> changesPushed) Notify that a push was completed. This is a signal to the project that some resources may no longer be considered modified.- Parameters:
- changesPushed- A list of the changes that were pushed, which may be a subset of those retrieved via- getChanges()
 
 - 
removeAllProjectResourceListenerspublic void removeAllProjectResourceListeners() Removes allProjectResourceListeners. This should only be used when shutting down a designer instance or switching the projects in the designer.
 
- 
 
-