12. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Components for reuse
13. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Components for reuse
‣ l10n-DSL: if you Java8, e4 and want dynamic language
flipping
14. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Components for reuse
‣ l10n-DSL: if you Java8, e4 and want dynamic language
flipping
‣ RRobot-DSL: allows you to describe eclipse-project setups
15. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Components for reuse
‣ l10n-DSL: if you Java8, e4 and want dynamic language
flipping
‣ RRobot-DSL: allows you to describe eclipse-project setups
‣ LivePreview: Reuse the live preview to present your
textual content in a visual way
16. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Components for reuse
‣ l10n-DSL: if you Java8, e4 and want dynamic language
flipping
‣ RRobot-DSL: allows you to describe eclipse-project setups
‣ LivePreview: Reuse the live preview to present your
textual content in a visual way
‣ CSSExt-DSL: allows you to define your custom CSS-
Properties
19. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ DSL to define translations
l10n-DSL
20. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ DSL to define translations
‣ Uses Xtext
l10n-DSL
21. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ DSL to define translations
‣ Uses Xtext
‣ Generates code and text files
l10n-DSL
22. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ DSL to define translations
‣ Uses Xtext
‣ Generates code and text files
‣ Requires Java8
‣ Makes use of Java8 functional interfaces and method
references
l10n-DSL
23. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
l10n-DSL
‣ DSL to store language definitions
package sample.l10n.app.themes {
bundle BasicMessages default en {
HelloWorld {
en : '''Hello World''',
de : '''Hallo Welt'''
}
}
bundle SamplePartMessages default en {
Button_title [ BasicMessages.HelloWorld ]
Current_Date(DATE now) {
en : '''«now "MM/dd/yyyy"»''',
de : '''«now "dd.MM.yyyy"»'''
}
}
}
24. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
l10n-DSL
‣ Generated artifacts
‣ ${bundle}.java: e4 message class
‣ ${bundle}.properties: Default transalations
‣ ${bundle}_${lang}.properties: Translations for the lang
‣ ${bundle}Registry.java: Registry to use for binding
25. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ Use in code (Sample JavaFX)
l10n-DSL
package sample.l10n.app.themes;
public class SamplePart {
@Inject
SamplePartMessagesRegistry messagesReg;
@PostConstruct
void init(BorderPane pane) {
Button b = new Button();
messagesReg.register(b::setText, messagesReg::Button_title);
pane.setCenter(b);
Label l = new Label();
messagesReg.register(b::setText,
messagesReg.Current_Date_supplier(new Date()));
pane.setTop(l);
}
}
26. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ Use in code (Sample SWT)
l10n-DSL
package sample.l10n.app.themes;
public class SamplePart {
@Inject
SamplePartMessagesRegistry messagesReg;
@PostConstruct
void init(Composite pane) {
Button b = new Button(pane,SWT.PUSH);
messagesReg.register(b::setText, messagesReg::Button_title);
Label l = new Label(pane,SWT.NONE);
messagesReg.register(b::setText,
messagesReg.Current_Date_supplier(new Date()));
}
}
35. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
LivePreview
‣ LivePreview was developed for FXML/FXGraph immediate
feedback
36. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
LivePreview
‣ LivePreview was developed for FXML/FXGraph immediate
feedback
‣ Expects FXML passed
37. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
LivePreview
‣ LivePreview was developed for FXML/FXGraph immediate
feedback
‣ Expects FXML passed
‣ LivePreview requests FXML from editors who adapt to
IFXMLProviderAdapter
41. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
CSSExt-DSL
‣ CSS-Editor has NO hard coded properties
42. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
CSSExt-DSL
‣ CSS-Editor has NO hard coded properties
‣ Properties available are defined in an extra file ending
with .cssext
43. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
CSSExt-DSL
‣ CSS-Editor has NO hard coded properties
‣ Properties available are defined in an extra file ending
with .cssext
‣ CSS-Editor looks up .cssext-Files from projects classpath
53. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
@Log & Logger-API
‣ Simple slf4j like API
‣ Used internally by e(fx)clipse runtime
‣ Implementation provided as an OSGi-Service/
ServiceLoader
54. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
@Log & Logger-API
‣ Simple slf4j like API
‣ Used internally by e(fx)clipse runtime
‣ Implementation provided as an OSGi-Service/
ServiceLoader
‣ Multiple ways to consume
‣ Through OSGi-Service-Registry
‣ Through a factory
‣ Through DI with @Log
65. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
@Service
‣ Eclipse DI by default does NOT conform to OSGi-Service
semantics
‣ Services can come and go
‣ Requestor of services is important if a ServiceFactory
is used
66. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
public class DIServiceConsumer {
@Inject
public void setServices(@Service List<LoggerFactory> serviceList) {
}
@Inject
public void setServices(@Service LoggerFactory serviceList) {
}
}
@Service
67. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Fileystem Service
‣ Service on top of NIO2 low level API
68. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Fileystem Service
‣ Service on top of NIO2 low level API
public class FilesystemSample extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FilesystemService fs = Util.lookupService(FilesystemSample.class, FilesystemService.class);
Subscription observePath = fs.observePath(Paths.get(URI.create("file:/Users/tomschindl")), (k,p) -> {
System.err.print("filesystem item '"+p+"' has been ");
switch (k) {
case CREATE:
System.err.println("created.");
break;
case DELETE:
System.err.println("deleted.");
break;
default:
System.err.println("modified.");
break;
}
});
// .....
observePath.dispose();
}
}
73. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
StyledText APIs
‣ Non Editable Text: StyledLabel & StyledString
74. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
StyledText APIs
‣ Non Editable Text: StyledLabel & StyledString
StyledString s = new StyledString();
s.appendSegment("Hello", "h1");
s.appendSegment("World!", "h1","colorful");
StyledLabel label = new StyledLabel(s);
75. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
StyledText APIs
‣ Non Editable Text: StyledLabel & StyledString
StyledString s = new StyledString();
s.appendSegment("Hello", "h1");
s.appendSegment("World!", "h1","colorful");
StyledLabel label = new StyledLabel(s);
.h1 {
-fx-font-size: 20pt;
}
.colorful {
-fx-font-weight: bold;
-fx-fill: linear-gradient( from 0.0% 0.0% to 100.0% 100.0%, rgb(128,179,128)
0.0, rgb(255,179,102) 100.0);
}
76. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ StyledText in List/Table/TreeView
StyledText APIs
77. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ StyledText in List/Table/TreeView
StyledText APIs
public interface OutlineItem {
public CharSequence getLabel();
public Node getGraphic();
public OutlineItem getParent();
public ObservableList<OutlineItem> getChildren();
}
78. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
‣ StyledText in List/Table/TreeView
StyledText APIs
public interface OutlineItem {
public CharSequence getLabel();
public Node getGraphic();
public OutlineItem getParent();
public ObservableList<OutlineItem> getChildren();
}
private TreeView<OutlineItem> createView() {
TreeView<OutlineItem> outlineView = new TreeView<>();
outlineView.setShowRoot(false);
outlineView.setCellFactory(this::createCell);
return outlineView;
}
TreeCell<OutlineItem> createCell(TreeView<OutlineItem> param) {
return new SimpleTreeCell<OutlineItem>(
i -> i.getLabel(), i -> i.getGraphic(), i ->
Collections.emptyList());
}
84. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Compensator
‣ Mission 0: Must look slick!
85. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Compensator
‣ Mission 0: Must look slick!
‣ Mission 1: Create a simple source editor like Notepad++
who:
‣ Is process light-weight
‣ Makes it easy to add new language highlightings
86. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Compensator
‣ Mission 0: Must look slick!
‣ Mission 1: Create a simple source editor like Notepad++
who:
‣ Is process light-weight
‣ Makes it easy to add new language highlightings
‣ Mission 2: Allow the simple source editor to expand to a
(simple) IDE:
‣ where Source-Editor, VCS (git), Ticketsystem (eg.
github), CI (eg. travis) are core components fully
integrated with each other
‣ Easy to integrate: Does not depend on core.resources
97. (c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0
Compensator - Roadmap
‣ Tighter integration with git workflow
‣ Improve Java autocomplete & Error Annotations
‣ Support for JavaScript auto-complete & error reporting
‣ Support for Xtext-Languages (their upcoming IntelliJ
support should help us)
‣ Connect it to Flux to get a Flux Compensator