Class AbstractResourceCollection
java.lang.Object
com.inductiveautomation.ignition.common.resourcecollection.AbstractResourceCollection
- All Implemented Interfaces:
ResourceCollection
- Direct Known Subclasses:
DesignerProjectTreeImpl
,RuntimeResourceCollection
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.common.resourcecollection.ResourceCollection
GLOBAL_PROJECT_NAME, PIPELINE_PROJECT_NAME, PROJECT_NAME_PATTERN, SFC_PROJECT_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addResourceListener
(ResourceListener listener) Adds a listener for specific types of resource changes.protected Map<ResourcePath,
Resource> protected CopyOnWriteArrayList<ResourceListener>
Get the effectiveResource
s for this project.boolean
Short-circuiting evaluation of whether project has any resources of given type.void
removeResourceListener
(ResourceListener listener) Removes an existing listener.protected ResourceCollectionDiff.EffectiveDiff
Call this after one or more resources or manifests have been changed.protected ResourceCollectionDiff.EffectiveDiff
updateEffectiveState
(@Nullable Object contextObject) 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.common.resourcecollection.ResourceCollection
browse, getAllResources, getDescription, getInheritanceStructure, getManifest, getName, getParent, getResource, getResource, getSingletonResource, getSnapshots, getTitle, isEnabled, isInheritable, isRunnable
-
Constructor Details
-
AbstractResourceCollection
public AbstractResourceCollection()
-
-
Method Details
-
getListeners
-
getEffectiveResources
- Returns:
- the effective resources for this project, calculated by looking at the inheritance chain of resource collections. Inherited resources will have their paths re-mapped so that all resources appear to originate from this resource collection.
-
getResources
Description copied from interface:ResourceCollection
Get the effectiveResource
s for this project.This includes inherited resources from parent projects, recursively, except where resources in child projects override resources by the same name from parent projects. In other words, for any given
ResourcePath
, only the resource "closest" to this project in the inheritance chain will be included in this list.Note that depending on the
ResourceFilter
used to load this project instance, this may not include all resource types that are actually part of this project.- Specified by:
getResources
in interfaceResourceCollection
- Returns:
- the effective
Resource
s for this project.
-
updateEffectiveState
Call this after one or more resources or manifests have been changed. This will calculate the effective change to the resources and notify listeners. -
updateEffectiveState
protected ResourceCollectionDiff.EffectiveDiff updateEffectiveState(@Nullable @Nullable Object contextObject) -
getResourcesOfType
Description copied from interface:ResourceCollection
Get all non-folderResource
s of typetype
belonging to the module identified bymoduleId
.Resource types belonging to the Ignition platform are identified by module id "ignition".
- Specified by:
getResourcesOfType
in interfaceResourceCollection
- Parameters:
type
- the resource type.- Returns:
- all non-folder
Resource
s of typetype
belonging to the module identified bymoduleId
. - See Also:
-
hasResourcesOfType
Description copied from interface:ResourceCollection
Short-circuiting evaluation of whether project has any resources of given type.- Specified by:
hasResourcesOfType
in interfaceResourceCollection
- Parameters:
type
- the resource type.- Returns:
true
if the project contains at least one resource of the given type.See also:
ProjectLifecycleFactory#getProjectFilter()
- See Also:
-
addResourceListener
Description copied from interface:ResourceCollection
Adds a listener for specific types of resource changes.- Specified by:
addResourceListener
in interfaceResourceCollection
- Parameters:
listener
- theResourceListener
to add.
-
removeResourceListener
Description copied from interface:ResourceCollection
Removes an existing listener. If not added, no-op.- Specified by:
removeResourceListener
in interfaceResourceCollection
- Parameters:
listener
- theResourceListener
to remove.
-