Runtime

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

java.lang.Object
  extended byorg.eclipse.gef.Request
      extended byorg.eclipse.gef.requests.CreateRequest
          extended byorg.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest
All Implemented Interfaces:
DropRequest
Direct Known Subclasses:
CreateViewAndElementRequest

public class CreateViewRequest
extends CreateRequest

A request to create new IView (s) To instantiate this request, clients have to create a ViewDescriptor or a list of ViewDescriptor s filling it with view creation parameters. The ViewDescriptor is a inner class to this request The request object can be used to obtain a view creation command from a target EditPart Once such command is executed, the request cannot be reused again to create another view. A different instance of the reqyest has to be used instead


Nested Class Summary
static class CreateViewRequest.ViewDescriptor
          A view descriptor that contains attributes needed to create the view The class is also a mutable adapter that initially adapts to nothing, but can adapt to IView after the view has been created (by executing the creation command returned from edit policies in response to this request) This is how GEF works!!
 
Constructor Summary
CreateViewRequest(CreateViewRequest.ViewDescriptor viewDescriptor)
          Constructor for CreateViewRequest using a ViewDescriptor
CreateViewRequest(EObject element, PreferencesHint preferencesHint)
          Convenience constructor for CreateViewRequest using a IElement
CreateViewRequest(java.util.List viewDescriptors)
          Constructor for CreateViewRequest using a list of ViewDescriptor s
CreateViewRequest(java.lang.Object type, CreateViewRequest.ViewDescriptor viewDescriptor)
          Constructor for CreateViewRequest using a request type and a ViewDescriptor
CreateViewRequest(java.lang.Object type, java.util.List viewDescriptors)
          Constructor for CreateViewRequest using a request type and list of ViewDescriptor s
 
Method Summary
protected  CreationFactory getFactory()
          The factory mechanism is not used
 java.lang.Object getNewObject()
          A list of IAdaptable objects that adapt to View .class
 java.lang.Object getNewObjectType()
          The type is a List of IAdaptable objects that adapt to IView .class
 java.util.List getViewDescriptors()
          Returns the viewDescriptors list
 void setFactory(CreationFactory factory)
          The factory mechanism is not used
 
Methods inherited from class org.eclipse.gef.requests.CreateRequest
getLocation, getSize, setLocation, setSize
 
Methods inherited from class org.eclipse.gef.Request
getExtendedData, getType, setExtendedData, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreateViewRequest

public CreateViewRequest(EObject element,
                         PreferencesHint preferencesHint)
Convenience constructor for CreateViewRequest using a IElement

Parameters:
element - a semantic element
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>.

CreateViewRequest

public CreateViewRequest(CreateViewRequest.ViewDescriptor viewDescriptor)
Constructor for CreateViewRequest using a ViewDescriptor

Parameters:
viewDescriptor - a view descriptor

CreateViewRequest

public CreateViewRequest(java.util.List viewDescriptors)
Constructor for CreateViewRequest using a list of ViewDescriptor s

Parameters:
viewDescriptors - a list of view descriptors

CreateViewRequest

public CreateViewRequest(java.lang.Object type,
                         CreateViewRequest.ViewDescriptor viewDescriptor)
Constructor for CreateViewRequest using a request type and a ViewDescriptor

Parameters:
type - request type
viewDescriptor - a view descriptor

CreateViewRequest

public CreateViewRequest(java.lang.Object type,
                         java.util.List viewDescriptors)
Constructor for CreateViewRequest using a request type and list of ViewDescriptor s

Parameters:
type - the request type
viewDescriptors - a list of view descriptors
Method Detail

getViewDescriptors

public java.util.List getViewDescriptors()
Returns the viewDescriptors list

Returns:
List of ViewDescriptor s

getNewObject

public java.lang.Object getNewObject()
A list of IAdaptable objects that adapt to View .class

See Also:
CreateRequest.getNewObject()

getNewObjectType

public java.lang.Object getNewObjectType()
The type is a List of IAdaptable objects that adapt to IView .class

See Also:
CreateRequest.getNewObjectType()

getFactory

protected CreationFactory getFactory()
The factory mechanism is not used

Throws:
java.lang.UnsupportedOperationException

setFactory

public void setFactory(CreationFactory factory)
The factory mechanism is not used


Runtime

Guidelines for using Eclipse APIs.

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