|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest
org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest
public class CreateElementRequest
Request to create a new model element.
If the request is not constructed with the editing domain through which to create the new model element, it will be derived from the container element.
Field Summary |
---|
Fields inherited from interface org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest |
---|
REPLACE_DEFAULT_COMMAND |
Constructor Summary | |
---|---|
CreateElementRequest(org.eclipse.emf.ecore.EObject container,
IElementType elementType)
Creates a request to create a new model element. |
|
CreateElementRequest(org.eclipse.emf.ecore.EObject container,
IElementType elementType,
org.eclipse.emf.ecore.EReference containmentFeature)
Creates a request to create a new model element. |
|
CreateElementRequest(IElementType elementType)
Creates a request to create a new model element. |
|
CreateElementRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
org.eclipse.emf.ecore.EObject container,
IElementType elementType)
Creates a request to create a new model element. |
|
CreateElementRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
org.eclipse.emf.ecore.EObject container,
IElementType elementType,
org.eclipse.emf.ecore.EReference containmentFeature)
Creates a request to create a new model element. |
|
CreateElementRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
IElementType elementType)
Creates a request to create a new model element. |
Method Summary | |
---|---|
org.eclipse.emf.ecore.EObject |
createContainer()
Sets the appropriate container for the new element. |
IClientContext |
getClientContext()
Infers the client context from getElementType() if the context
has not be explicity set. |
org.eclipse.emf.ecore.EObject |
getContainer()
Gets the original context in which the new element will be created. |
org.eclipse.emf.ecore.EReference |
getContainmentFeature()
Gets the containment feature in which to create the new element. |
protected java.lang.String |
getDefaultLabel()
Gets the default edit command label. |
java.lang.Object |
getEditHelperContext()
Makes a request for the context of the new element from its element type. |
org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain()
Gets the editing domain in which I am requesting to make model changes. |
java.util.List |
getElementsToEdit()
Gets the elements that will be changed when the work is done for this request. |
IElementType |
getElementType()
Gets the element type for the new model element. |
org.eclipse.emf.ecore.EObject |
getNewElement()
Gets the new element that has been created by this request. |
void |
initializeContainmentFeature(org.eclipse.emf.ecore.EReference feature)
Sets the containment feature in which to create the new element. |
protected void |
invalidateContainmentFeature()
Invalidates the cached containment feature. |
protected void |
invalidateEditHelperContext()
Invalidates the cached edit context request and command. |
void |
setClientContext(IClientContext clientContext)
Sets the client context for this request. |
void |
setContainer(org.eclipse.emf.ecore.EObject container)
Sets the container for the new element. |
void |
setContainmentFeature(org.eclipse.emf.ecore.EReference containmentFeature)
Sets the containment feature in which to create the new element. |
void |
setNewElement(org.eclipse.emf.ecore.EObject element)
Sets the element that has been created by this request. |
void |
setParameter(java.lang.String parameterName,
java.lang.Object value)
Sets the value of the parameter named parameterName to
value . |
Methods inherited from class org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest |
---|
addParameters, getLabel, getParameter, getParameters, setEditingDomain, setLabel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CreateElementRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.emf.ecore.EObject container, IElementType elementType)
editingDomain
- the editing domain in which I am requesting to make model
changes.container
- the container for the new model elementelementType
- the element type of the new model elementpublic CreateElementRequest(org.eclipse.emf.ecore.EObject container, IElementType elementType)
container
.
container
- the container for the new model elementelementType
- the element type of the new model elementpublic CreateElementRequest(IElementType elementType)
getContainer()
.
elementType
- the element type of the new model elementpublic CreateElementRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, IElementType elementType)
editingDomain
- the editing domain in which I am requesting to make model
changes.elementType
- the element type of the new model elementpublic CreateElementRequest(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, org.eclipse.emf.ecore.EObject container, IElementType elementType, org.eclipse.emf.ecore.EReference containmentFeature)
editingDomain
- the editing domain in which I am requesting to make model
changes.container
- the container for the new model elementelementType
- the element type of the new model elementcontainmentFeature
- The feature in the container which will hold the new model
element. Can be null
, in which case a default
feature will be used.public CreateElementRequest(org.eclipse.emf.ecore.EObject container, IElementType elementType, org.eclipse.emf.ecore.EReference containmentFeature)
container
.
container
- the container for the new model elementelementType
- the element type of the new model elementcontainmentFeature
- The feature in the container which will hold the new model
element. Can be null
, in which case a default
feature will be used.Method Detail |
---|
public org.eclipse.emf.ecore.EObject getNewElement()
public void setNewElement(org.eclipse.emf.ecore.EObject element)
element
- the newly created elementpublic org.eclipse.emf.ecore.EReference getContainmentFeature()
null
.
null
if one has not
been specified.Opublic void setContainmentFeature(org.eclipse.emf.ecore.EReference containmentFeature)
Does nothing of the feature has not changed. Othewise, invalidates the edit helper context.
containmentFeature
- the containment featurepublic void initializeContainmentFeature(org.eclipse.emf.ecore.EReference feature)
Does nothing of the feature has not changed. Does not invalidate the edit helper context.
containmentFeature
- the containment featurepublic org.eclipse.emf.ecore.EObject getContainer()
createContainer
method is called.
public org.eclipse.emf.ecore.EObject createContainer()
container
for the new element. May
prompt the user to create the container, so this method should only be
called when the command honouring the request is executed.
Updates the value returned by the getContainer
, if
appropriate.
public void setContainer(org.eclipse.emf.ecore.EObject container)
Does nothing of the container has not changed. Othewise, invalidates the edit helper context and containment feature.
container
- the container for the new element.public void setClientContext(IClientContext clientContext)
IEditCommandRequest
setClientContext
in interface IEditCommandRequest
setClientContext
in class AbstractEditCommandRequest
clientContext
- the client contextpublic IClientContext getClientContext()
getElementType()
if the context
has not be explicity set.
getClientContext
in interface IEditCommandRequest
getClientContext
in class AbstractEditCommandRequest
public IElementType getElementType()
public java.util.List getElementsToEdit()
IEditCommandRequest
getElementsToEdit
in interface IEditCommandRequest
getElementsToEdit
in class AbstractEditCommandRequest
protected java.lang.String getDefaultLabel()
AbstractEditCommandRequest
getDefaultLabel
in class AbstractEditCommandRequest
public java.lang.Object getEditHelperContext()
The GetContextCommand
will not be executed. This method
relies on the command to return the new context element type until it is
executed, at which point it can return the real context element, if a new
one needs to be created.
public void setParameter(java.lang.String parameterName, java.lang.Object value)
AbstractEditCommandRequest
parameterName
to
value
.
setParameter
in interface IEditCommandRequest
setParameter
in class AbstractEditCommandRequest
parameterName
- the parameter namevalue
- the parameter valueprotected void invalidateEditHelperContext()
protected void invalidateContainmentFeature()
public org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
IEditCommandRequest
getEditingDomain
in interface IEditCommandRequest
getEditingDomain
in class AbstractEditCommandRequest
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.