public interface ConditionalDeleteService extends DeleteService
DeleteService
protocol that supports conditional deletion,
respecting a model's edit providers when they provide unexecutable commands to veto
deletion. Implementations of this interface should be registered as
OSGi services providing DeleteService
because the framework looks for that
service interface but will test whether the implementation also provides this extension.
Whether the extension interface is also declared to OSGi is left to the provider's discretion.Modifier and Type | Method and Description |
---|---|
static ConditionalDeleteService |
adapt(DeleteService service)
Obtain a view of a given
service as conditional delete service, if necessary adapting a service
implementation that does not provide the ConditionalDeleteService protocol with a default deletion
condition. |
boolean |
canDelete(Iterable<?> objects)
Queries whether all of the given
objects can be deleted. |
default boolean |
canDelete(Object object)
Queries whether an
object can be deleted. |
default boolean |
canRemove(Object owner,
Object reference,
Iterable<?> objects)
Query whether all of the given
objects in some reference feature of an owner of
that
feature can be removed from the reference feature. |
default boolean |
canRemove(Object owner,
Object reference,
Object object)
Query whether an
object in some reference feature of an owner of that
feature can be removed from the reference feature. |
static ConditionalDeleteService |
getDeleteService(EMFFormsViewContext context)
Obtain a conditional delete service for a given
context , if necessary
adapting its service implementation. |
deleteElement, deleteElements
dispose, getPriority, instantiate
default boolean canDelete(Object object)
object
can be deleted. By convention a null
value
cannot be deleted.object
- an object to be deletedfalse
if the object
cannot be deleted or is null
; true
, otherwiseboolean canDelete(Iterable<?> objects)
objects
can be deleted.objects
- a number of objects to be deletedfalse
if any of the objects cannot be deleted; true
otherwise, including the case of no
objects
default boolean canRemove(Object owner, Object reference, Object object)
object
in some reference
feature of an owner
of that
feature can be removed from the reference
feature. In the case of containment references,
this amounts to deletion of the object
.owner
- the owner of a reference
to some object
reference
- a reference feature of the owner
object
- an object referenced by the owner
from which it is to be removedobject
may be removeddefault boolean canRemove(Object owner, Object reference, Iterable<?> objects)
objects
in some reference
feature of an owner
of
that
feature can be removed from the reference
feature. In the case of containment references,
this amounts to deletion of the object
.owner
- the owner of a reference
to some object
reference
- a reference feature of the owner
objects
- a group of objects referenced by the owner
from which they are to be removedobjects
may be removedstatic ConditionalDeleteService getDeleteService(EMFFormsViewContext context)
context
, if necessary
adapting its service implementation.context
- a form contextConditionalDeleteService
protocol or if there isn't a delete service at all (in which case
nothing can be deleted)adapt(DeleteService)
static ConditionalDeleteService adapt(DeleteService service)
service
as conditional delete service, if necessary adapting a service
implementation that does not provide the ConditionalDeleteService
protocol with a default deletion
condition. In that case, an object is assumed to be deletable if it is not null
and it is an
EObject
that has some container from which it can be removed (root elements not logically
being deletable).service
- a delete serviceConditionalDeleteService
protocol or if the original service
is null
Copyright © 2020. All rights reserved.