Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Eclipse meets e4
1. Setting Up the
Development Workbench
• Copy both to your local disk:
• the right archive for your platform
• the folder material
• Hand the USB stick to the attendee next to you.
• Unzip the archive and start the included Eclipse with a
fresh workspace.
• NOTE: On Windows systems, make sure you pick a short
directory name and everything gets extracted without
errors.
2. meets
Developing an editor
for the e4 workbench model
16. Run the Demo
• Import the Contacts Demo application as a
project
• Try to run the Contacts Demo product
(fails, but creates a run config)
• Run again by means of the run configuration
51. handler org.eclipse.e4.demo.contacts.handlers.ExitHandler
for contacts.exit
handler org.eclipse.e4.demo.contacts.handlers.SaveHandler
for contacts.save
handler org.eclipse.e4.demo.contacts.handlers.DarkThemeHandler
for contacts.darkTheme
handler org.eclipse.e4.demo.contacts.handlers.BrightThemeHandler
for contacts.brightTheme
handler org.eclipse.e4.demo.contacts.handlers.DeleteContactHandler
for contacts.delete
bind "CTRL+D" to contacts.darkTheme
bind "CTRL+L" to contacts.brightTheme
bind "CTRL+S" to contacts.save
bind "CTRL+5 X" to contacts.exit
bind "Delete" to contacts.delete
command contacts.exit "Exit"
command contacts.darkTheme "Dark Theme"
command contacts.brightTheme "Bright Theme"
command contacts.save "Save"
command contacts.delete "Delete"
52. handler org.eclipse.e4.demo.contacts.handlers.ExitHandler
for contacts.exit
handler org.eclipse.e4.demo.contacts.handlers.SaveHandler
for contacts.save
handler org.eclipse.e4.demo.contacts.handlers.DarkThemeHandler
for contacts.darkTheme
handler org.eclipse.e4.demo.contacts.handlers.BrightThemeHandler
for contacts.brightTheme
handler org.eclipse.e4.demo.contacts.handlers.DeleteContactHandler
for contacts.delete
bind "CTRL+D" to contacts.darkTheme
bind "CTRL+L" to contacts.brightTheme
bind "CTRL+S" to contacts.save
bind "CTRL+5 X" to contacts.exit
bind "Delete" to contacts.delete Add
command contacts.exit "Exit" namespace
command contacts.darkTheme "Dark Theme"
command contacts.brightTheme "Bright Theme"
command contacts.save "Save"
command contacts.delete "Delete"
53. application contacts
handler org.eclipse.e4.demo.contacts.handlers.ExitHandler
handler contacts.exit
for org.eclipse.e4.demo.contacts.handlers.ExitHandler
handler org.eclipse.e4.demo.contacts.handlers.SaveHandler
for exit
handler contacts.save
for org.eclipse.e4.demo.contacts.handlers.SaveHandler
handler org.eclipse.e4.demo.contacts.handlers.DarkThemeHandler
for save
handler contacts.darkTheme
for org.eclipse.e4.demo.contacts.handlers.DarkThemeHandler
handler org.eclipse.e4.demo.contacts.handlers.BrightThemeHandler
for darkTheme
handler contacts.brightTheme
for org.eclipse.e4.demo.contacts.handlers.BrightThemeHandler
handler org.eclipse.e4.demo.contacts.handlers.DeleteContactHandler
for brightTheme
handler contacts.delete
for org.eclipse.e4.demo.contacts.handlers.DeleteContactHandler
for delete
bind "CTRL+D" to contacts.darkTheme
bind "CTRL+L" to contacts.brightTheme
"CTRL+D" darkTheme
bind "CTRL+S" to contacts.save
"CTRL+L" brightTheme
bind "CTRL+5 X" to contacts.ex
"CTRL+S" to save
bind "CTRL+5 X" to exit
bind "Delete" to
it delete
command contacts.exit "Exit"
exit
command contacts.darkTheme "Dark Theme"
darkTheme
command contacts.brightTheme "Bright Theme"
brightTheme
command contacts.save "Save"
save
command contacts.delete "Delete"
delete
54. Exercise:
A Grammar for Commands
application contacts
handler org.eclipse.e4.demo.contacts.handlers.ExitHandler for exit
handler org.eclipse.e4.demo.contacts.handlers.SaveHandler for save
handler org.eclipse.e4.demo.contacts.handlers.DarkThemeHandler for darkTheme
handler org.eclipse.e4.demo.contacts.handlers.BrightThemeHandler for brightTheme
handler org.eclipse.e4.demo.contacts.handlers.DeleteContactHandler for delete
bind "CTRL+D" to darkTheme
bind "CTRL+L" to brightTheme
bind "CTRL+S" to save
bind "CTRL+5 X" to exit
bind "Delete" to delete
command exit "Exit"
command darkTheme "Dark Theme"
command brightTheme "Bright Theme"
command save "Save"
command delete "Delete"
82. GlobalScope
name EObject
outerScope
... all visible
FQNs
elements
83. GlobalScope
name EObject
outerScope
... all visible
FQNs
elements
DefaultGlobalScopeProvider
84. GlobalScope
name EObject
outerScope
... all visible
FQNs
elements
DefaultGlobalScopeProvider
• all in workspace
85. GlobalScope
name EObject
outerScope
... all visible
FQNs
elements
DefaultGlobalScopeProvider
• all in workspace
• backed by an Eclipse builder
86. GlobalScope
name EObject
outerScope
... all visible
FQNs
elements
DefaultGlobalScopeProvider
• all in workspace
• backed by an Eclipse builder
ResourceSetGlobalScopeProvider
87. GlobalScope
name EObject
outerScope
... all visible
FQNs
elements
DefaultGlobalScopeProvider
• all in workspace
• backed by an Eclipse builder
ResourceSetGlobalScopeProvider
• all in ResourceSet
88. Namespace Imports
Global
name EObject
„java.util.List“ 1
„java.util.Set“ 2
„java.util.Map“ 3
89. Namespace Imports
Global
name EObject
„java.util.List“ 1
„java.util.Set“ 2
„java.util.Map“ 3
Import:
Grammar 'import' importedNamespace=ImportFQN;
90. Namespace Imports
Global
name EObject
„java.util.List“ 1
„java.util.Set“ 2
„java.util.Map“ 3
Import:
Grammar 'import' importedNamespace=ImportFQN;
Model import java.util.*
91. Namespace Imports
Global ImportNamespaceAware
name EObject name EObject
„java.util.List“ 1 „List“ 1
outerScope
„java.util.Set“ 2 „Set“ 2
„java.util.Map“ 3 „Map“ 3
Import:
Grammar 'import' importedNamespace=ImportFQN;
Model import java.util.*
96. Dependency Injection
• Based on Google Guice
• Pervasively used in Xtext
• Invisible for clients (ex. Annotations)
97. Dependency Injection
• Based on Google Guice
• Pervasively used in Xtext
• Invisible for clients (ex. Annotations)
• Language specific and global injectors
98. Dependency Injection
• Based on Google Guice
• Pervasively used in Xtext
• Invisible for clients (ex. Annotations)
• Language specific and global injectors
• Makes overriding defaults easy
100. DI: Configuration
@ImplementedBy(MyServiceImpl.class)
public class IServiceInterface {
...
public class MyDeclarativeModule extends AbstractModule {
public Class<? extends IQualifiedNameProvider>
bindIQualifiedNameProvider() {
return MyQualifiedNameProvider.class;
}
...
@Singleton
public class MySingletonService extends AbstractSomeService {
...
107. Outlook
• Improve Xtext support for
• Ecore generics
• Partial textual models
• EP org.eclipse.e4.workbench.model
108. Questions?
find out more at
http://www.xtext.org
http://eclipse.org/e4
Editor's Notes
Die DSL f&#xFC;r DSLs, Eclipse-basiert
Define textual DSLs easily, Ready-to-use tool-chain, Easy but flexible customizing and tweaking,
Durable foundation with Java Eclipse EMF, Strong community