Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Papyrus/Papyrus Developer Guide/Embedded Editors Developer Documentation"
m (Quentin.lemenez.cea.fr moved page Papyrus Developer Guide/Embedded Editors Developer Documentation to Papyrus/Papyrus Developer Guide/Embedded Editors Developer Documentation) |
|||
(5 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Papyrus]] | ||
=Embedded Editors= | =Embedded Editors= | ||
Line 36: | Line 37: | ||
*Papyrus editors priority is set to medium | *Papyrus editors priority is set to medium | ||
*Papyrus editors, defined to be the default ones, their priority is set at 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: | ||
+ | {|class="wikitable" | ||
+ | !Type | ||
+ | !Extend | ||
+ | !Implement | ||
+ | |- | ||
+ | |Simple Editor | ||
+ | | | ||
+ | |<code>org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration</code> | ||
+ | |- | ||
+ | |Advanced Editor | ||
+ | |<code>org.eclipse.jface.dialogs.Dialog</code> | ||
+ | |<code>org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration</code> | ||
+ | |- | ||
+ | |Popup Editor | ||
+ | | | ||
+ | |<code>org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration</code> | ||
+ | |} | ||
+ | A basic implementation of Direct Editor is provided <code>org.eclipse.papyrus.extensionpoints.editors.configuration.DefaultDirectEditorConfiguration</code> | ||
== Constraint Editor == | == 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 <code>org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConstraint</code> and define both methods: | ||
+ | {|class="wikitable" | ||
+ | !Method | ||
+ | !Description | ||
+ | |- | ||
+ | |<code>public boolean appliesTo(Object selection)</code>|| Concrete implementation of filtering on selection | ||
+ | |- | ||
+ | |<code>public String getLabel()</code>||Name to describe the kind of constraint | ||
+ | |} | ||
==List of specific editors by UML elements== | ==List of specific editors by UML elements== |
Latest revision as of 05:09, 26 January 2018
Contents
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 |