Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Papyrus/Papyrus Developer Guide/Embedded Editors Developer Documentation

Embedded Editors

Papyrus uses embedded editors to provide specific functionalities (parsing, validation...) for UML elements. External user can provide own editors through extension point: org.eclipse.papyrus.extensionpoints.editors.DirectEditor

Direct Editor

The Direct Editor is defined by:

Notion Description
Language This language used with the Direct Editor
Object To Edit The UML element to edit(ex:org.eclipse.uml2.uml.Property)
Priority The consideration of Direct Editor.
Icon Image to display for the Direct Editor.
Contributor It is the informations concerning the creator of le Direct Editor
Editor The type of implementation used as Direct Editor
Constraint(optional) If the Direct Editor is not applied for all instances of the UML Element

Priority policy

There are 5 levels : Lowest, Low, Medium, High, Highest

- This priority policy has been defined so that:

  • an external contribution is NOT the default editor with the classic configuration (LOW)
  • an external contribution can be set to default editor(use High or Highest)

- To achieve that:

  • the default priority is set to low
  • Papyrus editors priority is set to medium
  • Papyrus editors, defined to be the default ones, their priority is set at medium

Editor

Three kinds of Editor can be defined to edit an UML Element:

Type Extend Implement
Simple Editor org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration
Advanced Editor org.eclipse.jface.dialogs.Dialog org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration
Popup Editor org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration

A basic implementation of Direct Editor is provided org.eclipse.papyrus.extensionpoints.editors.configuration.DefaultDirectEditorConfiguration

Constraint Editor

A constraint can be associated with an Editor. The constraint provides a simple way to filter the current selection which is an instance of UML element to edit. The Constraint must implement org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConstraint and define both methods:

Method Description
public boolean appliesTo(Object selection) Concrete implementation of filtering on selection
public String getLabel() Name to describe the kind of constraint

List of specific editors by UML elements

UML Element Direct Editor
org.eclipse.uml2.uml.Constraint Essential OCL constraint editor
Textual editor for constraint edition with VSL
JAVA Constraint
org.eclipse.uml2.uml.OpaqueExpression Essential OCL constraint editor
org.eclipse.uml2.uml.ValueSpecification Value Specification Xtext editor
org.eclipse.uml2.uml.NamedElement Textual Editor For NamedElement

Back to the top