Runtime

org.eclipse.gmf.runtime.diagram.ui.requests
Class CreateUnspecifiedTypeRequest

java.lang.Object
  extended byorg.eclipse.gef.Request
      extended byorg.eclipse.gef.requests.CreateRequest
          extended byorg.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest
All Implemented Interfaces:
DropRequest

public class CreateUnspecifiedTypeRequest
extends CreateRequest

This request encapsulates a list of CreateViewRequest or CreateViewAndElementRequest for each type that this tool supports. Each method in CreateRequest that is called to configure the request in CreationTool is propagated to each individual request.


Field Summary
protected  java.util.List elementTypes
          List of element types of which one will be created (of type IElementType).
protected  java.util.Map requests
          A map containing the CreateRequest for each element type.
 
Constructor Summary
CreateUnspecifiedTypeRequest(java.util.List elementTypes, PreferencesHint preferencesHint)
          Creates a new CreateUnspecifiedTypeRequest.
 
Method Summary
protected  void createRequests()
          Creates a CreateViewRequest or CreateViewAndElementRequest for each creation hint and adds it to the map of requests.
 java.util.List getElementTypes()
          Returns the list of element types.
 java.lang.Object getNewObject()
           
 java.lang.Object getNewObjectType()
           
protected  PreferencesHint getPreferencesHint()
          Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values.
 CreateRequest getRequestForType(IElementType creationHint)
          Returns the CreateRequest for the element type passed in.
 void setExtendedData(java.util.Map map)
           
 void setFactory(CreationFactory factory)
           
 void setLocation(Point location)
           
 void setNewObject(java.util.Collection theNewObjects)
          Sets the new object to be returned.
 void setSize(Dimension size)
           
 void setType(java.lang.Object type)
           
 
Methods inherited from class org.eclipse.gef.requests.CreateRequest
getFactory, getLocation, getSize
 
Methods inherited from class org.eclipse.gef.Request
getExtendedData, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementTypes

protected java.util.List elementTypes
List of element types of which one will be created (of type IElementType).


requests

protected java.util.Map requests
A map containing the CreateRequest for each element type.

Constructor Detail

CreateUnspecifiedTypeRequest

public CreateUnspecifiedTypeRequest(java.util.List elementTypes,
                                    PreferencesHint preferencesHint)
Creates a new CreateUnspecifiedTypeRequest.

Parameters:
elementTypes - List of element types of which one will be created (of type IElementType).
preferencesHint - The preference hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. The preference hint is mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>.
Method Detail

createRequests

protected void createRequests()
Creates a CreateViewRequest or CreateViewAndElementRequest for each creation hint and adds it to the map of requests.


getRequestForType

public CreateRequest getRequestForType(IElementType creationHint)
Returns the CreateRequest for the element type passed in.

Parameters:
creationHint -
Returns:
the CreateRequest

getElementTypes

public java.util.List getElementTypes()
Returns the list of element types.

Returns:
Returns the list of element types.

getPreferencesHint

protected PreferencesHint getPreferencesHint()
Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. The preference hint is mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>.

Returns:
the preferences hint

setLocation

public void setLocation(Point location)

setType

public void setType(java.lang.Object type)

setSize

public void setSize(Dimension size)

setFactory

public void setFactory(CreationFactory factory)

setExtendedData

public void setExtendedData(java.util.Map map)

setNewObject

public void setNewObject(java.util.Collection theNewObjects)
Sets the new object to be returned. Must be of the type expected in getNewObjectType().

Parameters:
theNewObjects -

getNewObject

public java.lang.Object getNewObject()

getNewObjectType

public java.lang.Object getNewObjectType()

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.