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. |
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
static 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 © 2019. All rights reserved.