Class SingleResourceListener
java.lang.Object
com.inductiveautomation.ignition.designer.project.SingleResourceListener
- All Implemented Interfaces:
ResourceListener
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 TypeMethodDescriptionstatic SingleResourceListener
create
(ResourcePath resourcePath, Consumer<Resource> onModifiedConsumer, Runnable onDeletedRunnable) Lambda style creator if you don't want to make your own subclass.static SingleResourceListener
create
(ResourcePath path, Consumer<Resource> onCreate, Consumer<Resource> onModified, Runnable onDelete) Lambda style creator with an optional onCreate consumerGet theResourceFilter
used to filter resources this listener cares about.boolean
protected void
protected abstract void
protected abstract void
onModified
(Resource 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.resourcecollection.ResourceListener
manifestChanged, onAfterChanges, onBeforeChanges
-
Constructor Details
-
SingleResourceListener
-
-
Method Details
-
create
public static SingleResourceListener create(ResourcePath resourcePath, Consumer<Resource> onModifiedConsumer, Runnable onDeletedRunnable) Lambda style creator if you don't want to make your own subclass. -
create
public static SingleResourceListener create(ResourcePath path, Consumer<Resource> onCreate, Consumer<Resource> 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 interfaceResourceListener
-
onCreated
-
resourcesModified
public final void resourcesModified(String projectName, List<ChangeOperation.ModifyResourceOperation> resources) - Specified by:
resourcesModified
in interfaceResourceListener
-
onModified
-
resourcesDeleted
public final void resourcesDeleted(String projectName, List<ChangeOperation.DeleteResourceOperation> signatures) - Specified by:
resourcesDeleted
in interfaceResourceListener
-
onDeleted
protected abstract void onDeleted() -
getResourceFilter
Description copied from interface:ResourceListener
Get theResourceFilter
used to filter resources this listener cares about. Default is to care about all resources.- Specified by:
getResourceFilter
in interfaceResourceListener
- 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(Resource)
oronDeleted()
-
isEnabled
public boolean isEnabled()
-