Package org.eclipse.gef.requests
Class CreateRequest
java.lang.Object
org.eclipse.gef.Request
org.eclipse.gef.requests.CreateRequest
- All Implemented Interfaces:
- DropRequest
- Direct Known Subclasses:
- CreateConnectionRequest
A Request to create a new object.
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a CreateRequest with the default type.CreateRequest(Object type) Creates a CreateRequest with the given type.
- 
Method SummaryModifier and TypeMethodDescriptionprotected CreationFactoryReturns the CreationFactory for this request.Returns the location of the object to be created.Gets the new object from the factory and returns that object.Returns the type of the new object.getSize()Returns the size of the object to be created.booleanReturnstrueif snap-to is enabledvoidsetFactory(CreationFactory factory) Sets the factory to be used when creating the new object.voidsetLocation(Point location) Sets the location where the new object will be placed.voidSets the size of the new object.voidsetSnapToEnabled(boolean value) Used to set whether snap-to is being performed.Methods inherited from class org.eclipse.gef.RequestgetExtendedData, getType, setExtendedData, setType
- 
Constructor Details- 
CreateRequestpublic CreateRequest()Creates a CreateRequest with the default type.
- 
CreateRequestCreates a CreateRequest with the given type.- Parameters:
- type- The type of request.
 
 
- 
- 
Method Details- 
getFactoryReturns the CreationFactory for this request.- Returns:
- the CreationFactory
 
- 
getLocationReturns the location of the object to be created.- Specified by:
- getLocationin interface- DropRequest
- Returns:
- the location
 
- 
getNewObjectGets the new object from the factory and returns that object.- Returns:
- the new object
 
- 
getNewObjectTypeReturns the type of the new object.- Returns:
- the type of the new object
 
- 
getSizeReturns the size of the object to be created.- Returns:
- the size
 
- 
isSnapToEnabledpublic boolean isSnapToEnabled()Returnstrueif snap-to is enabled- Returns:
- trueif the request is for a creation with snap-to enabled
- Since:
- 3.7
 
- 
setFactorySets the factory to be used when creating the new object.- Parameters:
- factory- the factory
 
- 
setLocationSets the location where the new object will be placed.- Parameters:
- location- the location
 
- 
setSizeSets the size of the new object.- Parameters:
- size- the size
 
- 
setSnapToEnabledpublic void setSnapToEnabled(boolean value) Used to set whether snap-to is being performed.- Parameters:
- value-- trueif the request is for a creation with snap-to enabled
- Since:
- 3.7
 
 
-