Package org.eclipse.emf.ecp.edit.spi
Class EMFDeleteServiceImpl
- java.lang.Object
-
- org.eclipse.emf.ecp.edit.spi.EMFDeleteServiceImpl
-
- All Implemented Interfaces:
ConditionalDeleteService
,DeleteService
,ViewModelService
public class EMFDeleteServiceImpl extends java.lang.Object implements ConditionalDeleteService
Default EMF implementation of theDeleteService
. UsesDeleteCommand
respectively.- Since:
- 1.6
- Author:
- jfaltermeier
-
-
Constructor Summary
Constructors Constructor Description EMFDeleteServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canDelete(java.lang.Iterable<?> objects)
Queries whether all of the givenobjects
can be deleted.boolean
canRemove(java.lang.Object owner, java.lang.Object feature, java.lang.Iterable<?> objects)
Query whether all of the givenobjects
in somereference
feature of anowner
of that feature can be removed from thereference
feature.void
deleteElement(java.lang.Object toDelete)
Deletes the given object from the containment tree.void
deleteElements(java.util.Collection<java.lang.Object> toDelete)
Deletes the given objects from the containment tree.void
dispose()
Dispose.int
getPriority()
Returns the priority for this view service.void
instantiate(ViewModelContext context)
Instantiate the view service.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecp.edit.spi.ConditionalDeleteService
canDelete, canRemove
-
-
-
-
Method Detail
-
instantiate
public void instantiate(ViewModelContext context)
Description copied from interface:ViewModelService
Instantiate the view service.- Specified by:
instantiate
in interfaceViewModelService
- Parameters:
context
- theViewModelContext
-
dispose
public void dispose()
Description copied from interface:ViewModelService
Dispose.- Specified by:
dispose
in interfaceViewModelService
-
getPriority
public int getPriority()
Description copied from interface:ViewModelService
Returns the priority for this view service.- Specified by:
getPriority
in interfaceViewModelService
- Returns:
- the priority
-
deleteElements
public void deleteElements(java.util.Collection<java.lang.Object> toDelete)
Description copied from interface:DeleteService
Deletes the given objects from the containment tree. This will cut all references to the deleted objects.- Specified by:
deleteElements
in interfaceDeleteService
- Parameters:
toDelete
- the objects to delete
-
deleteElement
public void deleteElement(java.lang.Object toDelete)
Description copied from interface:DeleteService
Deletes the given object from the containment tree. This will cut all references to the deleted object.- Specified by:
deleteElement
in interfaceDeleteService
- Parameters:
toDelete
- the object to delete
-
canDelete
public boolean canDelete(java.lang.Iterable<?> objects)
Description copied from interface:ConditionalDeleteService
Queries whether all of the givenobjects
can be deleted.- Specified by:
canDelete
in interfaceConditionalDeleteService
- Parameters:
objects
- a number of objects to be deleted- Returns:
false
if any of the objects cannot be deleted;true
otherwise, including the case of noobjects
-
canRemove
public boolean canRemove(java.lang.Object owner, java.lang.Object feature, java.lang.Iterable<?> objects)
Description copied from interface:ConditionalDeleteService
Query whether all of the givenobjects
in somereference
feature of anowner
of that feature can be removed from thereference
feature. In the case of containment references, this amounts to deletion of theobject
.- Specified by:
canRemove
in interfaceConditionalDeleteService
- Parameters:
owner
- the owner of areference
to someobject
feature
- a reference feature of theowner
objects
- a group of objects referenced by theowner
from which they are to be removed- Returns:
- whether the
objects
may be removed
-
-