Class SingleProjectResourceListener
java.lang.Object
com.inductiveautomation.ignition.designer.project.SingleProjectResourceListener
- All Implemented Interfaces:
ProjectResourceListener
public abstract class SingleProjectResourceListener
extends Object
implements ProjectResourceListener
A version of project resource listener that only listens for changes to a specific resource, and is suppressible.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(ResourcePath resourcePath, Consumer<ProjectResource> onModifiedConsumer, Runnable onDeletedRunnable) Lambda style creator if you don't want to make your own subclass.create
(ResourcePath path, Consumer<ProjectResource> onCreate, Consumer<ProjectResource> onModified, Runnable onDelete) Lambda style creator with an optional onCreate consumerGet theResourceFilter
used to filter resources this listener cares about.boolean
protected void
onCreated
(ProjectResource resource) protected abstract void
protected abstract void
onModified
(ProjectResource newResource) final void
resourcesCreated
(String projectName, List<ChangeOperation.CreateResourceOperation> resources) final void
resourcesDeleted
(String projectName, List<ChangeOperation.DeleteResourceOperation> signatures) final void
resourcesModified
(String projectName, List<ChangeOperation.ModifyResourceOperation> resources) void
setEnabled
(boolean enabled) 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.project.ProjectResourceListener
manifestChanged, onAfterChanges, onBeforeChanges
-
Constructor Details
-
SingleProjectResourceListener
-
-
Method Details
-
create
public static SingleProjectResourceListener create(ResourcePath resourcePath, Consumer<ProjectResource> onModifiedConsumer, Runnable onDeletedRunnable) Lambda style creator if you don't want to make your own subclass. -
create
public static SingleProjectResourceListener create(ResourcePath path, Consumer<ProjectResource> onCreate, Consumer<ProjectResource> onModified, Runnable onDelete) Lambda style creator with an optional onCreate consumer -
resourcesCreated
public final void resourcesCreated(String projectName, List<ChangeOperation.CreateResourceOperation> resources) - Specified by:
resourcesCreated
in interfaceProjectResourceListener
-
onCreated
-
resourcesModified
public final void resourcesModified(String projectName, List<ChangeOperation.ModifyResourceOperation> resources) - Specified by:
resourcesModified
in interfaceProjectResourceListener
-
onModified
-
resourcesDeleted
public final void resourcesDeleted(String projectName, List<ChangeOperation.DeleteResourceOperation> signatures) - Specified by:
resourcesDeleted
in interfaceProjectResourceListener
-
onDeleted
protected abstract void onDeleted() -
getResourceFilter
Description copied from interface:ProjectResourceListener
Get theResourceFilter
used to filter resources this listener cares about. Default is to care about all resources.- Specified by:
getResourceFilter
in interfaceProjectResourceListener
- Returns:
- the
ResourceFilter
used to filter resources this listener cares about.
-
setEnabled
public void setEnabled(boolean enabled) - Parameters:
enabled
- when set to false, this listener will never invokeonModified(ProjectResource)
oronDeleted()
-
isEnabled
public boolean isEnabled()
-