public interface IFeatureCreator
It uses a callback
to signal changes to the feature or to signal that the creation has finished.
Users of this class need to
start
creation
send events
to the creator
feature changes
finished
IFeatureCreator
instances can be used multiple times. Creating a new instance should only start
after the last one has finished
.
Modifier and Type | Method and Description |
---|---|
EventResult |
onEvent(IInputEvent inputEvent,
FeatureCreateContext context)
Handles the given event, and returns if the event was handled or not.
|
void |
start(IFeatureCreateCallback callback,
FeatureCreateContext context)
This method is called to start creation.
|
void start(@NotNull IFeatureCreateCallback callback, @NotNull FeatureCreateContext context) throws NullPointerException
After this call, IFeatureCreator#onEvent
can be called.
When a IFeatureCreator
was started, it can not be started again until it has stopped
. Implementations of this method are encouraged to throw an exception in that case to signal a programming error by the caller of this method.
callback
- the callback to signal feature changes, and whether creation for the feature has finished, cannot be null
.context
- the creation context, cannot be null
NullPointerException
- when null
is passed.@NotNull EventResult onEvent(@NotNull IInputEvent inputEvent, @NotNull FeatureCreateContext context) throws NullPointerException
inputEvent
- an event, cannot be null
context
- the creation context, cannot be null
NullPointerException
- when null
is passed.