Runtime

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

    java.lang.Object
      org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor

All Implemented Interfaces:
  IAdaptable

Direct Known Subclasses:
  CreateConnectionViewRequest.ConnectionViewDescriptor, CreateViewAndElementRequest.ViewAndElementDescriptor

Enclosing class:
  CreateViewRequest

public static class CreateViewRequest.ViewDescriptor
extends java.lang.Object
implements IAdaptable

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.ViewDescriptor(IAdaptable elementAdapter, java.lang.Class viewkind, boolean persisted, PreferencesHint preferencesHint)` Creates a new view descriptor using element adapter and a view kind
`CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter, java.lang.Class viewkind, PreferencesHint preferencesHint)` Creates a new view descriptor using element adapter and a view kind
`CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter, java.lang.Class viewkind, java.lang.String semanticHint, boolean persisted, PreferencesHint preferencesHint)` Creates a new view descriptor using element adapter, a view kind and a factory hint
`CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter, java.lang.Class viewKind, java.lang.String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint)` Creates a new view descriptor using the supplied element adapter, view kind, factory hint, index and persistence flag.
`CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter, java.lang.Class viewKind, java.lang.String factoryHint, int index, PreferencesHint preferencesHint)` Creates a new view descriptor using the supplied element adapter, view kind, factory hint and index.
`CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter, java.lang.Class viewkind, java.lang.String semanticHint, PreferencesHint preferencesHint)` Creates a new view descriptor using element adapter, a view kind and a factory hint
`CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter, PreferencesHint preferencesHint)` Creates a new view descriptor using element adapter

Method Summary
`java.lang.Object` `getAdapter(java.lang.Class adapter)` Adapts to IView
`IAdaptable` `getElementAdapter()` Method getelementAdapter.
`int` `getIndex()` Method getIndex.
`PreferencesHint` `getPreferencesHint()` Gets the preferences hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values.
`java.lang.String` `getSemanticHint()` Method getSemanticHint.
`java.lang.Class` `getViewKind()` Method getViewKind.
`boolean` `isPersisted()` Return `true` if the view will be persisted; otherwise `false`
`void` `setPersisted(boolean persisted)` Method setPersisted.
`void` `setView(View view)` Method setView.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CreateViewRequest.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using element adapter

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `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.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            java.lang.Class viewkind,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using element adapter and a view kind

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `viewkind` - the kind of the view to be created (a concrete class derived from IView)
  `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.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            java.lang.Class viewkind,
                                            boolean persisted,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using element adapter and a view kind

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `viewkind` - the kind of the view to be created (a concrete class derived from IView)
  `persisted` - indicates if the view will be created as a persisted view or transient
  `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.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            java.lang.Class viewkind,
                                            java.lang.String semanticHint,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using element adapter, a view kind and a factory hint

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `viewkind` - the kind of the view to be created
  `semanticHint` - the semantic hint of the view
  `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.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            java.lang.Class viewkind,
                                            java.lang.String semanticHint,
                                            boolean persisted,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using element adapter, a view kind and a factory hint

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `viewkind` - the kind of the view to be created
  `semanticHint` - the semantic hint of the view
  `persisted` - indicates if the view will be created as a persisted view or transient
  `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.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            java.lang.Class viewKind,
                                            java.lang.String factoryHint,
                                            int index,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using the supplied element adapter, view kind, factory hint and index.

  Same as calling `new ViewDescriptor(elementAdapter, viewKind, factoryHint, index, true);`

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `viewKind` - the kind of the view to be created (a concrete class derived from View)
  `factoryHint` - the semantic hint of the view
  `index` - the index of the view in its parent's children collection

### CreateViewRequest.ViewDescriptor

    public CreateViewRequest.ViewDescriptor(IAdaptable elementAdapter,
                                            java.lang.Class viewKind,
                                            java.lang.String semanticHint,
                                            int index,
                                            boolean persisted,
                                            PreferencesHint preferencesHint)

  Creates a new view descriptor using the supplied element adapter, view kind, factory hint, index and persistence flag.

Parameters:
  `elementAdapter` - the element adapter referened by the view
  `viewKind` - the kind of the view to be created (a concrete class derived from View)
  `semanticHint` - the semantic hint of the view
  `index` - the index of the view in its parent's children collection
  `persisted` - set <true> to create a persisted (attached) view; `false` to create a detached (non-persisted) view.

Method Detail

### getAdapter

    public java.lang.Object getAdapter(java.lang.Class adapter)

  Adapts to IView

  Specified by:
    `getAdapter` in interface `IAdaptable`
  See Also:
    `IAdaptable.getAdapter(Class)`

### setView

    public void setView(View view)

  Method setView.

  Parameters:
    `view` -

### setPersisted

    public void setPersisted(boolean persisted)

  Method setPersisted.

  Parameters:
    `persisted` -

### getElementAdapter

    public IAdaptable getElementAdapter()

  Method getelementAdapter.

  Returns:
    IAdaptable

### getViewKind

    public java.lang.Class getViewKind()

  Method getViewKind.

  Returns:
    Class

### getSemanticHint

    public java.lang.String getSemanticHint()

  Method getSemanticHint.

  Returns:
    String

### getIndex

    public int getIndex()

  Method getIndex.

  Returns:
    int

### isPersisted

    public final boolean isPersisted()

  Return `true` if the view will be persisted; otherwise `false`

  Returns:
    `true` or `false`

### getPreferencesHint

    public 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

Runtime

Guidelines for using Eclipse APIs.

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