model my pde!
TRANSCRIPT
![Page 2: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/2.jpg)
Agenda
PDE origins
EMF+ Forms + other cool stuff EMF Forms!
Examplary project: Declarative Services tooling
![Page 3: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/3.jpg)
PDE as of 3.6, it is
Java model+
Text-editing framework+
OSGi integration+
Forms
March 25th, 2010© Sierra Wireless
![Page 4: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/4.jpg)
Fair enough…
March 25th, 2010© Sierra Wireless
![Page 5: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/5.jpg)
Bummer! A new OSGi header!
March 25th, 2010© Sierra Wireless
![Page 6: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/6.jpg)
What do you expect from an editor?
Undo/Redo Copy/Paste Error feedback
Drag&Drop Outline Properties view
Contextual actions
March 25th, 2010© Sierra Wireless
![Page 7: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/7.jpg)
And from an editing framework?
Standard widgets Extensible
Model-backed Simple
March 25th, 2010© Sierra Wireless
![Page 8: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/8.jpg)
March 25th, 2010© Sierra Wireless
EMF
![Page 9: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/9.jpg)
© Sierra Wireless
EMF Forms
A generic & tiny framework To build advanced editors on top of models Lives in PDE incubator• /cvsroot/eclipse• pde-incubator/modeling component
March 25th, 2010
![Page 10: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/10.jpg)
EMF Forms: the Editor
EmfFormEditor<? extends EObject>• Generic editor• Configurable
• Custom Forms toolkit• Outline?• Rich error tooltips?• Source page?
March 25th, 2010© Sierra Wireless
EmfFormEditor
IEmfFormEditorConfig
![Page 11: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/11.jpg)
EMF Forms: the Page
AbstractEmfFormPage• createContents()• bind()
March 25th, 2010© Sierra Wireless
![Page 12: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/12.jpg)
EMF Forms: Master/Details blocks
EmfMasterDetailBlock /EmfDetailsPart• Ease the process of registering details pages• Hierarchical databinding
(DetailsObservable)
March 25th, 2010© Sierra Wireless
![Page 13: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/13.jpg)
March 25th, 2010© Sierra Wireless
What? You’re not
using databinding
?!?
![Page 14: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/14.jpg)
Databinding
Linking objects with each other in a declarative and simple way Allows to specify• Conversion rules• Validation policies
March 25th, 2010© Sierra Wireless
ViewModel
Controller
![Page 15: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/15.jpg)
EMF Databinding
On top of the Edit layer Compact syntax Default behavior easily customizable
March 25th, 2010© Sierra Wireless
![Page 16: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/16.jpg)
Databinding examples
bindingContext.bindValue(ViewerProperties.input().
observe(_propertiesMasterDetail.getTreeViewer())
,
getEditor().getInputObservable());
March 25th, 2010© Sierra Wireless
![Page 17: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/17.jpg)
Databinding examples (MasterDetails)
bindingContext.bindValue(WidgetProperties.text(SWT.FocusOut).
observe(propertyComposite.getTextName())
, EMFEditProperties.value(getEditingDomain(),
ScrPackage.Literals.COMPONENT__NAME).
observeDetail(getCurrentSelection()));
March 25th, 2010© Sierra Wireless
![Page 18: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/18.jpg)
EditingDomain?
Every operation on the model is a Command This command being stacked on a CommandStack
March 25th, 2010© Sierra Wireless
![Page 19: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/19.jpg)
Undo/redo
CommandStack
Period.
March 25th, 2010© Sierra Wireless
![Page 20: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/20.jpg)
Model validation
« Simple » validation rules• Directly in the model• Code mostly generated if you use the http://www.eclipse.org/emf/2002/Ecore#constraints annotation
• On-demand
March 25th, 2010© Sierra Wireless
![Page 21: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/21.jpg)
Model validation
More complex rules• Contributed from the outside• Declaration• Fine-grained
March 25th, 2010© Sierra Wireless
![Page 22: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/22.jpg)
EMF Validation
Constraints defined in extension points• Bound to specific feature(s) and operation(s)
They can be written in Java, OCL… or any language
March 25th, 2010© Sierra Wireless
![Page 23: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/23.jpg)
Validation builder
ModelIncrementalBuilder• Generic builder• Detects modification on model files• Creates markers
• EMFFormEditor implements IGotoMarker
• Make things faster filtering on a content-type
March 25th, 2010© Sierra Wireless
![Page 24: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/24.jpg)
DS Tooling: the model
XSD Ecore
March 25th, 2010© Sierra Wireless
![Page 25: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/25.jpg)
DS Tooling: the model
March 25th, 2010© Sierra Wireless
![Page 26: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/26.jpg)
March 25th, 2010© Sierra Wireless
Demo!
![Page 27: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/27.jpg)
Roadmap (?)
Better text/modelsynchronization
Improve the API
Xtext integration
Exemplary project:OSGi bundle editor
Documentation
March 25th, 2010© Sierra Wireless
![Page 28: Model my PDE!](https://reader035.vdocument.in/reader035/viewer/2022081515/554bec8ab4c9056b348b512c/html5/thumbnails/28.jpg)
Feedback
PDE/UI bugzilla [modeling]
March 25th, 2010© Sierra Wireless