SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
MODERNIZE YOUR REAL-
WORLD APPLICATION WITH
E4 AND JAVAFX
COLE MARKHAM	

 	

 	

 	

SENIOR SOFTWARE ENGINEER	

THE WELLAND COMPANY	

!
!
CMARKHAM@WELLAND.COM
WELLAND BACKGROUND
• Welland Company celebrating 24 years	

• Flagship products	

• EXPORT	

• FORMS	

• IBM / Rocket Business Partner	

• Perform support for UniVerse / UniData sites
EXPORT PRODUCT OVERVIEW
• Transfers U2 data into an SQL compliant database	

• Access data for reporting, warehousing, and web
services	

• Empowers users to build reports and queries with
industry-standard tools.
EXPORT ARCHITECTURE
U2	

Database
EXPORT	

Server
SQL
Database
EXPORT
Client
MAKE IT LOOK LIKE IT WASN’T
BUILT IN 1995!
BUT IT’S BETTERTHANTHIS…
NEW SWING L&F?
DESIGNER’SVISION
BACKTOTHE DRAWING BOARD
• UI Frameworks	

• Swing	

• SWT	

• JavaFX	

• HTML5	

• .NET
• Application Frameworks	

• RCP 3.x	

• E4	

• Scout	

• Riena	

• .NET
Why JavaFX?
• FXML using SceneBuilder	

• CSS Styling	

• Chart library	

• e(fx)clipse tooling and E4 Renderers	

• Deployment via packaged application with JRE
CSS STYLING
• 500 Lines of CSS for our custom theme	

• E4 Renders add CSS classes
SCENE BUILDER
CHART LIBRARY
HTML5 SUPPORT
Why Eclipse 4?
• Modern architecture	

• Modularity	

• Application model	

• Custom Renderers	

• Dependency Injection	

• OSGi
RAPID PROTOTYPING
OSGI Bundle
EXPORT ARCHITECTURE
EXPORT	

Server
Old EXPORT Client
Equinox Framework
E4 Platform
e(fx)clipse
New Export Client
FXML LOADING
• Custom factory class used for most parts	

• Handles loading FXML resource defined in model	

• Controller class specified in FXML file	

• Inject @FXML variables into controller	

• Full Eclipse dependency injection support
FXML LOADING
public class FxmlLoadedPart{	
	 // Loaded from the fxml	
	 private Node mainControl;	
	 @PostConstruct	
	 public void postConstruct(	
	 	 	 @org.eclipse.fx.ui.di.FXMLLoader	
	 	 	 FXMLLoaderFactory factory,	
	 	 	 BorderPane parent,	
	 	 	 MPart part){	
	 	 try{	
	 	 	 String partFXML = part.getProperties().get("welland.part.fxml");	
	 	 	 if (partFXML == null){	
	 	 	 getLogger(this).warning("welland.part.fxml was null for part: " + part.getLabel() );	
	 	 	 return;	
	 	 	 }	
	 	 	 FXMLBuilder<Node> builder = factory.loadBundleRelative(partFXML);	
	 	 	 mainControl = builder.load();	
	 	 	 parent.setCenter(mainControl);	
	 	 }catch(IOException e){	
	 	 	 LoggerFactory.getFactory().getLogger(this).log(Level.WARNING,	
	 	 	 	 	 "Error loading fxml", e);	
	 	 }	
	 }	
	 @Focus	
	 public void onFocus(){	
	 	 mainControl.requestFocus();	
	 }	
}
• Custom factory class used for most parts
IMPLEMENTING A LOGIN DIALOG
IMPLEMENTING A LOGIN DIALOG
Defined as a Window in the application model	

Window contains a single Part	

Custom Window 

Renderer to set

modality
CUSTOM PERSPECTIVE SWITCHER
CUSTOM PERSPECTIVE SWITCHER
• Prototyped in SceneBuilder, defined in FXML	

• Radio Buttons with custom CSS	

• Implemented as aToolControl, in WindowTrimBar	

• Simpler implementation than MPerspectiveStack renderer	

• Listens to model for perspective changes	

• Updates model when buttons are pressed
CUSTOM PERSPECTIVE SWITCHER
Simple yet powerful CSS
CUSTOMTITLE BAR AND MENUS
CUSTOMTITLE BAR AND MENUS
• e(fx)clipse support for custom window decoration	

• Set efx.window.decoration.fxml in model	

• Custom Window renderer to populate icon, title
and menus	

• Application Addon to bind menus to perspectives
CUSTOMTITLE BAR AND MENUS
• Set tag on Menu in application model
CUSTOMTITLE BAR AND MENUS
public class PerspectiveMenuProcessingAddon {	
	 	
	 @Inject @Optional	
	 public void perspectiveChanged(	
	 	 	 @UIEventTopic(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT) Event event) {	
	 	 Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT);	
	 	 if(changedObj instanceof MPerspectiveStack){	
	 	 	 MPerspectiveStack perspectiveStack = (MPerspectiveStack)changedObj;	
	 	 	 MPerspective perspective = perspectiveStack.getSelectedElement();	
	 	 	 if (perspective != null && perspective.getContext() != null) {	
	 	 	 MWindow window = perspective.getContext().getActive(MWindow.class);	
	 	 	 MMenu mainMenu = window.getMainMenu();	
	 	 	 for (MMenuElement element: mainMenu.getChildren()) {	
	 	 	 List<String> tags = element.getTags();	
	 	 	 if (tags.contains("limitPerspectives")) {	
	 	 	 element.setVisible(tags.contains(perspective.getElementId()));	
	 	 	 }	
	 	 	 }	
	 	 	 }	
	 	 }	
	 }	
}
• Application Addon to bind menus to perspectives
DEPENDENCY INJECTIONTIPS
• Avoid generics	

• Use @Optional when appropriate	

• Use method injection with @Optional or dynamic objects	

• Active selection 

@Named(IServiceConstants.ACTIVE_SELECTION)	

• Use @UIEventTopic to receive notifications on the UI
thread
DEPENDENCY INJECTIONTIPS
• Avoid generics
public class ExampleTableHandler {	
	 @Execute	
public void execute(	
@Named(IServiceConstants.ACTIVE_SELECTION) 	
final List<Table> selectedTables) {	
	 // this will break if the active selection becomes List<Foo>	
	 	 for (Table table: selectedTables) {	
	 // do something with the table	
	 }	
	 }	
	 	 	
}
public class ExampleTableHandler {	
	 @Execute	
public void execute(	
@Named(IServiceConstants.ACTIVE_SELECTION) final Table[] selectedTables) {	
	 // do something with the tables	
	 }	
	 	 	
}
DEPENDENCY INJECTIONTIPS
• Use @Optional when injected object may not be available at
construction	

• Use methods with @Optional
@Inject	
@Optional	
public void populate(ExportOperations newOperations){	
	 // Save for later	
	 this.operations = newOperations;	
	 // Do something useful with the operations	
}
DEPENDENCY INJECTIONTIPS
• Active selection 

@Named(IServiceConstants.ACTIVE_SELECTION)	

• Different semantics than RCP 3.x	

• Useful for popup menus and master/detail views	

• Consider custom @Named variables	

• Only one part’s selection can be active	

• @Inject method not called when active part changes
DEPENDENCY INJECTIONTIPS
• Use @UIEventTopic to receive notifications on the UI thread	

• Post notifications using IEventBroker	

• Pub-Sub pattern enables decoupled code	

• Platform handles calling subscribers on the UIThread
@Inject	
@Optional	
public void insert(@UIEventTopic(EventConstants.TOPIC_NEW) Table table) {	
	 // New data added, add to our TableView data to refresh UI	
	 data.add(table);	
}
@Inject	
IEventBroker eventBroker;	 	
!
protected IStatus runInJobThread(IProgressMonitor monitor) {	
	 operations.add(table);	
	 eventBroker.post(EventConstants.TOPIC_NEW, table);	
	 return Status.OK_STATUS;	
}
Publish Subscribe
RESOURCES/ACKNOWLEDGMENTS
• http://eclipse.org/efxclipse	

• http://wiki.eclipse.org/Efxclipse/Tutorials
QUESTIONS?
EVALUATETHIS SESSION
Sign-in: www.eclipsecon.org
Select session from schedule
Evaluate:
1
2
3

Contenu connexe

Tendances

JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)Alexander Casall
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitMax Katz
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFXHendrik Ebbers
 
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Max Katz
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Max Katz
 
JavaFX – 10 things I love about you
JavaFX – 10 things I love about youJavaFX – 10 things I love about you
JavaFX – 10 things I love about youAlexander Casall
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedGil Fink
 
Angular Mini Hackathon Code Talks 2019
Angular Mini Hackathon Code Talks 2019Angular Mini Hackathon Code Talks 2019
Angular Mini Hackathon Code Talks 2019Maximilian Berghoff
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseRalf Sternberg
 
RichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowRichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowMax Katz
 
Design functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleDesign functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleMarian Wamsiedel
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedToru Wonyoung Choi
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating viewsecomputernotes
 

Tendances (20)

JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)
 
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF SummitAjax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
Ajax Applications with JSF 2 and New RichFaces 4 - JAX/JSF Summit
 
What is your money doing?
What is your money doing?What is your money doing?
What is your money doing?
 
Test Driven Development with JavaFX
Test Driven Development with JavaFXTest Driven Development with JavaFX
Test Driven Development with JavaFX
 
Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2Angular Workshop_Sarajevo2
Angular Workshop_Sarajevo2
 
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
Ajax Applications with JSF2 and New RichFaces 4 at JAX 2011
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
Ajax Applications with JSF 2 and New RichFaces 4 - CONFESS 2011
 
JavaFX – 10 things I love about you
JavaFX – 10 things I love about youJavaFX – 10 things I love about you
JavaFX – 10 things I love about you
 
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrivedStencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
 
Angular Mini Hackathon Code Talks 2019
Angular Mini Hackathon Code Talks 2019Angular Mini Hackathon Code Talks 2019
Angular Mini Hackathon Code Talks 2019
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 
RichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To KnowRichFaces 4 webinar #1: Everything You Need To Know
RichFaces 4 webinar #1: Everything You Need To Know
 
Angular Workshop FrOSCon 2018
Angular Workshop  FrOSCon 2018Angular Workshop  FrOSCon 2018
Angular Workshop FrOSCon 2018
 
Design functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleDesign functional solutions in Java, a practical example
Design functional solutions in Java, a practical example
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
 
Jetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO ExtendedJetpack, with new features in 2021 GDG Georgetown IO Extended
Jetpack, with new features in 2021 GDG Georgetown IO Extended
 
Gephi Toolkit Tutorial
Gephi Toolkit TutorialGephi Toolkit Tutorial
Gephi Toolkit Tutorial
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating views
 
Spring framework part 2
Spring framework  part 2Spring framework  part 2
Spring framework part 2
 

Similaire à Modernize Your Real-World Application with Eclipse 4 and JavaFX

Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Lars Vogel
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGMarakana Inc.
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UITech OneStop
 
Java development with the dynamo framework
Java development with the dynamo frameworkJava development with the dynamo framework
Java development with the dynamo frameworkPatrick Deenen
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedGil Fink
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4Jon Galloway
 
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsIntegration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsBizTalk360
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC PrinciplesPavlo Hodysh
 
Tips and tricks of the 2021.4 release
Tips and tricks of the 2021.4 releaseTips and tricks of the 2021.4 release
Tips and tricks of the 2021.4 releaseCristina Vidu
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI PresentationAjeeth Pingle
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentationmanolitto
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#Pascal Laurin
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)Hendrik Ebbers
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...HostedbyConfluent
 

Similaire à Modernize Your Real-World Application with Eclipse 4 and JavaFX (20)

Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010Eclipse 40 - Eclipse Summit Europe 2010
Eclipse 40 - Eclipse Summit Europe 2010
 
WPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA AustriaWPF and Prism 4.1 Workshop at BASTA Austria
WPF and Prism 4.1 Workshop at BASTA Austria
 
Learn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUGLearn about Eclipse e4 from Lars Vogel at SF-JUG
Learn about Eclipse e4 from Lars Vogel at SF-JUG
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
 
Eclipse e4
Eclipse e4Eclipse e4
Eclipse e4
 
Java development with the dynamo framework
Java development with the dynamo frameworkJava development with the dynamo framework
Java development with the dynamo framework
 
Stencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has ArrivedStencil: The Time for Vanilla Web Components has Arrived
Stencil: The Time for Vanilla Web Components has Arrived
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
 
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-FunctionsIntegration-Monday-Stateful-Programming-Models-Serverless-Functions
Integration-Monday-Stateful-Programming-Models-Serverless-Functions
 
SOLID & IoC Principles
SOLID & IoC PrinciplesSOLID & IoC Principles
SOLID & IoC Principles
 
Tips and tricks of the 2021.4 release
Tips and tricks of the 2021.4 releaseTips and tricks of the 2021.4 release
Tips and tricks of the 2021.4 release
 
Siebel Open UI Presentation
Siebel Open UI PresentationSiebel Open UI Presentation
Siebel Open UI Presentation
 
Applet in java
Applet in javaApplet in java
Applet in java
 
JavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io PresentationJavaLand 2014 - Ankor.io Presentation
JavaLand 2014 - Ankor.io Presentation
 
Implementing DDD with C#
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
S313937 cdi dochez
S313937 cdi dochezS313937 cdi dochez
S313937 cdi dochez
 
Fluttering
FlutteringFluttering
Fluttering
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
27 applet programming
27  applet programming27  applet programming
27 applet programming
 

Dernier

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Dernier (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Modernize Your Real-World Application with Eclipse 4 and JavaFX

  • 1. MODERNIZE YOUR REAL- WORLD APPLICATION WITH E4 AND JAVAFX COLE MARKHAM SENIOR SOFTWARE ENGINEER THE WELLAND COMPANY ! ! CMARKHAM@WELLAND.COM
  • 2. WELLAND BACKGROUND • Welland Company celebrating 24 years • Flagship products • EXPORT • FORMS • IBM / Rocket Business Partner • Perform support for UniVerse / UniData sites
  • 3. EXPORT PRODUCT OVERVIEW • Transfers U2 data into an SQL compliant database • Access data for reporting, warehousing, and web services • Empowers users to build reports and queries with industry-standard tools.
  • 5. MAKE IT LOOK LIKE IT WASN’T BUILT IN 1995!
  • 9. BACKTOTHE DRAWING BOARD • UI Frameworks • Swing • SWT • JavaFX • HTML5 • .NET • Application Frameworks • RCP 3.x • E4 • Scout • Riena • .NET
  • 10. Why JavaFX? • FXML using SceneBuilder • CSS Styling • Chart library • e(fx)clipse tooling and E4 Renderers • Deployment via packaged application with JRE
  • 11. CSS STYLING • 500 Lines of CSS for our custom theme • E4 Renders add CSS classes
  • 15. Why Eclipse 4? • Modern architecture • Modularity • Application model • Custom Renderers • Dependency Injection • OSGi
  • 17. OSGI Bundle EXPORT ARCHITECTURE EXPORT Server Old EXPORT Client Equinox Framework E4 Platform e(fx)clipse New Export Client
  • 18. FXML LOADING • Custom factory class used for most parts • Handles loading FXML resource defined in model • Controller class specified in FXML file • Inject @FXML variables into controller • Full Eclipse dependency injection support
  • 19. FXML LOADING public class FxmlLoadedPart{ // Loaded from the fxml private Node mainControl; @PostConstruct public void postConstruct( @org.eclipse.fx.ui.di.FXMLLoader FXMLLoaderFactory factory, BorderPane parent, MPart part){ try{ String partFXML = part.getProperties().get("welland.part.fxml"); if (partFXML == null){ getLogger(this).warning("welland.part.fxml was null for part: " + part.getLabel() ); return; } FXMLBuilder<Node> builder = factory.loadBundleRelative(partFXML); mainControl = builder.load(); parent.setCenter(mainControl); }catch(IOException e){ LoggerFactory.getFactory().getLogger(this).log(Level.WARNING, "Error loading fxml", e); } } @Focus public void onFocus(){ mainControl.requestFocus(); } } • Custom factory class used for most parts
  • 21. IMPLEMENTING A LOGIN DIALOG Defined as a Window in the application model Window contains a single Part Custom Window 
 Renderer to set
 modality
  • 23. CUSTOM PERSPECTIVE SWITCHER • Prototyped in SceneBuilder, defined in FXML • Radio Buttons with custom CSS • Implemented as aToolControl, in WindowTrimBar • Simpler implementation than MPerspectiveStack renderer • Listens to model for perspective changes • Updates model when buttons are pressed
  • 26. CUSTOMTITLE BAR AND MENUS • e(fx)clipse support for custom window decoration • Set efx.window.decoration.fxml in model • Custom Window renderer to populate icon, title and menus • Application Addon to bind menus to perspectives
  • 27. CUSTOMTITLE BAR AND MENUS • Set tag on Menu in application model
  • 28. CUSTOMTITLE BAR AND MENUS public class PerspectiveMenuProcessingAddon { @Inject @Optional public void perspectiveChanged( @UIEventTopic(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT) Event event) { Object changedObj = event.getProperty(UIEvents.EventTags.ELEMENT); if(changedObj instanceof MPerspectiveStack){ MPerspectiveStack perspectiveStack = (MPerspectiveStack)changedObj; MPerspective perspective = perspectiveStack.getSelectedElement(); if (perspective != null && perspective.getContext() != null) { MWindow window = perspective.getContext().getActive(MWindow.class); MMenu mainMenu = window.getMainMenu(); for (MMenuElement element: mainMenu.getChildren()) { List<String> tags = element.getTags(); if (tags.contains("limitPerspectives")) { element.setVisible(tags.contains(perspective.getElementId())); } } } } } } • Application Addon to bind menus to perspectives
  • 29. DEPENDENCY INJECTIONTIPS • Avoid generics • Use @Optional when appropriate • Use method injection with @Optional or dynamic objects • Active selection 
 @Named(IServiceConstants.ACTIVE_SELECTION) • Use @UIEventTopic to receive notifications on the UI thread
  • 30. DEPENDENCY INJECTIONTIPS • Avoid generics public class ExampleTableHandler { @Execute public void execute( @Named(IServiceConstants.ACTIVE_SELECTION) final List<Table> selectedTables) { // this will break if the active selection becomes List<Foo> for (Table table: selectedTables) { // do something with the table } } } public class ExampleTableHandler { @Execute public void execute( @Named(IServiceConstants.ACTIVE_SELECTION) final Table[] selectedTables) { // do something with the tables } }
  • 31. DEPENDENCY INJECTIONTIPS • Use @Optional when injected object may not be available at construction • Use methods with @Optional @Inject @Optional public void populate(ExportOperations newOperations){ // Save for later this.operations = newOperations; // Do something useful with the operations }
  • 32. DEPENDENCY INJECTIONTIPS • Active selection 
 @Named(IServiceConstants.ACTIVE_SELECTION) • Different semantics than RCP 3.x • Useful for popup menus and master/detail views • Consider custom @Named variables • Only one part’s selection can be active • @Inject method not called when active part changes
  • 33. DEPENDENCY INJECTIONTIPS • Use @UIEventTopic to receive notifications on the UI thread • Post notifications using IEventBroker • Pub-Sub pattern enables decoupled code • Platform handles calling subscribers on the UIThread @Inject @Optional public void insert(@UIEventTopic(EventConstants.TOPIC_NEW) Table table) { // New data added, add to our TableView data to refresh UI data.add(table); } @Inject IEventBroker eventBroker; ! protected IStatus runInJobThread(IProgressMonitor monitor) { operations.add(table); eventBroker.post(EventConstants.TOPIC_NEW, table); return Status.OK_STATUS; } Publish Subscribe
  • 36. EVALUATETHIS SESSION Sign-in: www.eclipsecon.org Select session from schedule Evaluate: 1 2 3