Class SingleProjectResourceListener
- java.lang.Object
-
- com.inductiveautomation.ignition.designer.project.SingleProjectResourceListener
-
- All Implemented Interfaces:
ProjectResourceListener
public abstract class SingleProjectResourceListener extends java.lang.Object implements ProjectResourceListener
A version of project resource listener that only listens for changes to a specific resource, and is suppressible.
-
-
Constructor Summary
Constructors Constructor Description SingleProjectResourceListener(ResourcePath resourcePath)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SingleProjectResourceListener
create(ResourcePath resourcePath, java.util.function.Consumer<ProjectResource> onModifiedConsumer, java.lang.Runnable onDeletedRunnable)
Lambda style creator if you don't want to make your own subclass.static SingleProjectResourceListener
create(ResourcePath path, java.util.function.Consumer<ProjectResource> onCreate, java.util.function.Consumer<ProjectResource> onModified, java.lang.Runnable onDelete)
Lambda style creator with an optional onCreate consumerResourceFilter
getResourceFilter()
Get theResourceFilter
used to filter resources this listener cares about.boolean
isEnabled()
protected void
onCreated(ProjectResource resource)
protected abstract void
onDeleted()
protected abstract void
onModified(ProjectResource newResource)
void
resourcesCreated(java.lang.String projectName, java.util.List<ChangeOperation.CreateResourceOperation> resources)
void
resourcesDeleted(java.lang.String projectName, java.util.List<ChangeOperation.DeleteResourceOperation> signatures)
void
resourcesModified(java.lang.String projectName, java.util.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 Detail
-
SingleProjectResourceListener
public SingleProjectResourceListener(ResourcePath resourcePath)
-
-
Method Detail
-
create
public static SingleProjectResourceListener create(ResourcePath resourcePath, java.util.function.Consumer<ProjectResource> onModifiedConsumer, java.lang.Runnable onDeletedRunnable)
Lambda style creator if you don't want to make your own subclass.
-
create
public static SingleProjectResourceListener create(ResourcePath path, java.util.function.Consumer<ProjectResource> onCreate, java.util.function.Consumer<ProjectResource> onModified, java.lang.Runnable onDelete)
Lambda style creator with an optional onCreate consumer
-
resourcesCreated
public final void resourcesCreated(java.lang.String projectName, java.util.List<ChangeOperation.CreateResourceOperation> resources)
- Specified by:
resourcesCreated
in interfaceProjectResourceListener
-
onCreated
protected void onCreated(ProjectResource resource)
-
resourcesModified
public final void resourcesModified(java.lang.String projectName, java.util.List<ChangeOperation.ModifyResourceOperation> resources)
- Specified by:
resourcesModified
in interfaceProjectResourceListener
-
onModified
protected abstract void onModified(ProjectResource newResource)
-
resourcesDeleted
public final void resourcesDeleted(java.lang.String projectName, java.util.List<ChangeOperation.DeleteResourceOperation> signatures)
- Specified by:
resourcesDeleted
in interfaceProjectResourceListener
-
onDeleted
protected abstract void onDeleted()
-
getResourceFilter
@Nonnull public ResourceFilter 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()
-
-