# Papyrus Module

Module used to interact with Papyrus Editor.

### Dependencies

This module depends on following other modules which will automatically be loaded.

- Uml module
- Notation module

## Method Overview

Method | Description
--- | ---
control() | Use the control function of papyrus.
createDiagram() | Create a new empty diagram.
eInstanceOf() | Return if the current instance is a instance of an EClass define by its name.
getModelSet() | Return the model set (ResourceSet) of the current model open in Papyrus.
getSelectionElement() | Return the UML element from the selection.
getSelectionView() | Return the select view element (Notation metamodel).

## Methods

### control

void control(org.eclipse.emf.ecore.EObject semanticElement, String fileName)

Use the control function of papyrus. That is to say that all contained element diagrams will be stored in a different resource.

semanticElement
  The semantic element to control (That is to say an UML element)
fileName
  The name of the new file

### createDiagram

void createDiagram(org.eclipse.emf.ecore.EObject semanticElement, [String diagramType], [String diagramName], [boolean open])

Create a new empty diagram. WARNING: For now only Class diagrams are implemented.

semanticElement
  UML or Sysml element of the diagram
diagramType
  currently only Class is supportedOptional: defaults to <"Class">.
diagramName
  The name of the diagram (Optional set the name to newDiagram)Optional: defaults to <"NewDiagram">.
open
  `true` if the diagram shall be openedOptional: defaults to <false>.

### eInstanceOf

boolean eInstanceOf(org.eclipse.emf.ecore.EObject eObject, String type)

Return if the current instance is a instance of an EClass define by its name. Will look into UML and Notation metamodel.

eObject
  The EObject you want to test.
type
  The name of the EClass defined in the metamodel

`true` if the EObject is instance of typeName

### getModelSet

org.eclipse.papyrus.infra.core.resource.ModelSet getModelSet()

Return the model set (ResourceSet) of the current model open in Papyrus.

current model set

### getSelectionElement

org.eclipse.uml2.uml.Element getSelectionElement()

Return the UML element from the selection.

UML element or `null`

### getSelectionView

org.eclipse.gmf.runtime.notation.View getSelectionView()

Return the select view element (Notation metamodel).

selection view or `null`