| Summary: | [All Diagrams] Direct Edit : Xtext / Papyrus integration | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Papyrus | Reporter: | Arnaud Cuccuru <arnaud.cuccuru> | ||||||
| Component: | Core | Assignee: | Project Inbox <mdt-papyrus-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Andreas.Muelder, ansgar.radermacher, cedric.dumoulin, cletavernier, rschnekenburger, yann.tanguy | ||||||
| Version: | 0.10.0 | ||||||||
| Target Milestone: | SR2 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | 357350, 429128, 429413 | ||||||||
| Bug Blocks: | 307862 | ||||||||
| Attachments: |
|
||||||||
|
Description
Arnaud Cuccuru
Previous direct edit dialogs had "ctrl + enter" key binding to close the editor. Is this key binding still relevant ? Is it possible to use "enter" instead ? Created attachment 173003 [details]
Glue plug-in between xtext editors and papyrus
Hi all, I have just posted an attachment concerning a contribution for item 1.3 (generic plug-in to be used as a glue between Papyrus and XText). The file is xtext_gmf_glue.zip. It contains a plug-in called org.eclipse.xtext.gmf.glue, which comes from the "XText/GMF integration example" (available in XText v1.0). I have just adapted it for the specific needs of Papyrus (many thanks to Nirmal Sasidharan and Cedric Dumoulin for their help). This seems to be globally OK, except: - a bug related to restoration of key binding for undo/redo when an xtext editor is closed (i.e., when the diagram editor gets the focus back) - a minor bug related to the deletion of temporary text files (used by popup editors), and update of the model explorer. I think it is however mature enough for commit. I will raise new bugs for the two items mentionned above as soon as it is committed. Cheers, Arnaud Created attachment 173009 [details]
XText-based pop-up editor for UML properties
Hi again, I have posted a new attachment: xtext_uml_property_editor.zip. This is a contribution for item 2.1 (textual editor for properties). It contains three plug-ins, which concern the realization of a textual editor for UML Properties. It has been generated using the XText frameworks, and it encapsulates the contributions for the DirectEdit extension point (modified according to item 1.1). Please note that it uses the plug-in org.eclipse.xtext.gmf.glue (see attachment xtext_gmg_glue.zip). Cheers, Arnaud (In reply to comment #1) > Previous direct edit dialogs had "ctrl + enter" key binding to close the editor. > Is this key binding still relevant ? Is it possible to use "enter" instead ? Hi Yann, By default, XText editors are multiline editors. The effect of pressing enter is then to insert a CR/NL. In the plug-in org.eclipse.xtext.gmf.glue I have posted, it is however possible to override the key binding for "enter". However, in the general case, multine line editors may be useful (e.g., for specyfing bodies of operations or OCL constraints), and I think it would be better to share a common mechanism for "closing and saving", whatever the editor is (a simple editor for e.g. properties, which does not really need multiline, or complex editor for e.g. bodies of operations). Currently, in Papyrus xtext editor, we can not specify a name that contains special characters such as: "-", "*", "&". We are constrained by java naming conventions. It would be nice, if we are no longer constrained by java naming conventions. The xtext integration broke selection in the model explorer, see bug 421392. This has been resolved with commit 937aa8afbdc6acf396f04c67ad752c78f59026f4: The xtext editor is now opened with the standard F2 key, i.e. the rename popup window will not open for elements handled by xtext. In the moment, this is the case for Properties only. When the xtext integration will cover more elements, the filter condition needs to be adjusted in the RenameNamedElementsHandler. There is a validation issue with the integration. The plugin org.eclipse.papyrus.uml.textedit.property.xtext.ui contains a test constraint that should probably have been removed before committing. This constraint does not execute properly, resulting in the following info message in the validation view upon the first validation: "The constraint "TEST" is disabled. It will not be evaluated." Removed test constraint with commit 74df1a9a52ad683d15a09cd9db1931c95f11b80a. The commit also includes a better check to disable the rename pop-up: it will not appear, if a direct editor is registered for the selected element (regardless whether xtext or not). Removed package oep.views.modelexplorer.xtext, since the package name was misleading: it was not specific to xtext but to support for editors embedded in the column viewer. Current status: all text editors have been ported to the new xtext integration, except the stereotype editor. The in-diagram editor works rather well, but the editor in the property view is almost unusable: - No undo/redo - No way to quit the editor without writing the contents back. (esc?) - When other tabs within the property view are selected: updates model and starts validation, even if not dirty (likely focus lost issue). - content assist is not taken into account after selection and triggers validation (likely GTK focus problem) Most issues with the editor in the property view have been fixed with commit 2a2b368a86e064a82a767aa5498a9949aa93a159 In particular - focus is no longer lost after an element in the editor has been selected. - Simple undo/redo support (no multi-character events) For all editor variants: validation does not popup a progress bar a more. The bar is not useful for validating a small sub-model/expression and caused additional focus issues. This task can be closed. Subtask Bug 328002 is not blocking (I remove the explicit dependency) |