public class AdaptOperation
extends java.lang.Object
implements org.eclipse.gmf.runtime.common.core.service.IOperation
domainElement
to
targetKind
.Modifier and Type | Field and Description |
---|---|
java.lang.Object |
source
Source element to adapt
|
org.eclipse.emf.ecore.EClass |
targetKind
Target EClass that the source element will adapt to.
|
Constructor and Description |
---|
AdaptOperation(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
java.lang.Object sourceElement,
org.eclipse.emf.ecore.EClass langKind,
boolean checkOnly)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
An
object is equal to this , if and only if it is
an instance of AdaptOperation and the domainElement
are of same type. |
java.lang.Object |
execute(org.eclipse.gmf.runtime.common.core.service.IProvider provider)
If the operation is just to check whether adapt will be successful, then
IModelMappingProvider.canAdapt(TransactionalEditingDomain, Object, EClass) is invoked else
IModelMappingProvider.adapt(TransactionalEditingDomain, Object, EClass) is invoked. |
int |
hashCode()
Hashcode for AdaptOperation is sum of hashcode for
Class of domainElement
and hashcode for the targetKind . |
public final java.lang.Object source
public final org.eclipse.emf.ecore.EClass targetKind
public AdaptOperation(org.eclipse.emf.transaction.TransactionalEditingDomain domain, java.lang.Object sourceElement, org.eclipse.emf.ecore.EClass langKind, boolean checkOnly)
domain
- TransactionalEditingDomain this operatino will take place
insourceElement
- Object source element to adaptlangKind
- EClass of the EObject that the source element will be
adapted tocheckOnly
- do not actually adapt, and only return a Boolean value
in the execute() method if true. When true, canAdapt() instead of
adapt() in IModelMappingProvider is called. When false, execute() will
call adapt() and return the adapted EObject.public java.lang.Object execute(org.eclipse.gmf.runtime.common.core.service.IProvider provider)
IModelMappingProvider.canAdapt(TransactionalEditingDomain, Object, EClass)
is invoked else
IModelMappingProvider.adapt(TransactionalEditingDomain, Object, EClass)
is invoked.execute
in interface org.eclipse.gmf.runtime.common.core.service.IOperation
IOperation.execute(IProvider)
public boolean equals(java.lang.Object object)
object
is equal to this
, if and only if it is
an instance of AdaptOperation
and the domainElement
are of same type. The targetKind
of both object
and
this
should be equal.equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
Class
of domainElement
and hashcode for the targetKind
.hashCode
in class java.lang.Object
Object.hashCode()