porting an application to the netbeanstm platform€¦ · > netbeans platform modules provide...
TRANSCRIPT
Porting an Application to the NetBeansTM PlatformGeertjan WielengaNetBeans Team
Anton EppleEppleton
2
AgendaIntroductionReal Life Porting ExperiencesDemo
3
GoalsMeet the NetBeans PlatformUnderstand its problem domainGet an overview of the main APIsA demo of porting to the NetBeans PlatformLearn what to do next
4
5
Why Use NetBeans PlatformInstead of Pure Swing?> Generic features for free (Update Manager, docking...)> Standardized L&F (Dialogs & Wizards, Options
Panels)> Modular structure (easy Dependency Management,
Versioning)> Less framework maintenance> Less boilerplate code
6
Why Use NetBeans PlatformInstead of Eclipse RCP?> NetBeans Platform when creating Swing Applications> Eclipse RCP when using SWT
7
How Does the NetBeans Platform Work?
> Runtime container manages lifecycle and dependencies of modules
> NetBeans Platform modules provide generic functionality, extension points and utility classes
> Application contains the modules providing application functionalityRuntime Container
API Modules/Plugins
App
Mod
ule
1
App
Mod
ule
4
App
Mod
ule
5
App
Mod
ule
6
App
Mod
ule
2
App
Mod
ule
3
8
What Are the Main Features & APIs?
> Window System > Action System> Dialogs & Wizards> Options & Settings> FileSystem & DataSystem> Internationalization> Help System
9
What Are the Most Important Parts?> Window System API
● TopComponents are the JPanels of NetBeans● Default Position (Mode) defined declaratively● Grouping, docking, sliding, dragging● Lifecycle (opened, showing, closing, closed... )
10
What Are the Most Important Parts?> Actions API
● Based on Swing Actions● Actions are registered declaratively● Base classes for advanced integration (CallablesystemAction)● Context dependent Action:
● Callback Action with delegate● Action that can act on selected components
11
What Are the Most Important Parts?> Dialogs API
● Based on java.awt.Dialog● Consistent display of standard messages● Customized messages● Elaborate Wizard Framework
12
What Are the Most Important Parts?> Nodes & Explorer Views
● Nodes are presentation objects wrapped around data objects● Can represent hierarchical data models● Act as model for exchangeable view Components
(ExplorerViews)● Interact with global selection management
13
What Are the Most Important Parts?> System Filesystem
● A general registry where every module can register UI components and resources
● A communication mechanism for loosely coupled communication
● A way to provide extension points and store user data
14
What Are the Most Important Parts?> Lookups
● A way to register and access services● A typesafe communication mechanism for loosely coupled
communication between modules● A way to provide extension points● A mechanism to manage global selection
15
The Porting Process> Third-party Libraries -> Library wrapper> Swing Panel -> TopComponent> Action -> register, ( CallableSystemAction,
CallbackSystemAction... )> Adjust Menus -> Layer (SystemFileSystem)> Dialogs, Wizards -> Dialogs API> Beans -> Node Wrappers> Synchronizing Views / Selection -> Lookup> ...
16
Lessons Learned> Took about 6 months to port (with lots of refactoring
involved)> First steps are simple...> ...then there's a steep learning curve.> NetBeans really helped reducing boilerplate code> The real gain from porting comes from adapting
NetBeans architecture
17
18
AgendaIntroductionReal Life Porting ExperiencesDemo
19
20
Nuance Voice XML
21
Fiorano Studio
22
Nokia Mobile Network
23
Sketsa SVG Editor
24
VisualVM
25
AIOTrade
26
JCae-CAD
27
MC4J JMX Console
28
JFugue Music NotePad
29
StudioSL: Oil Flow
30
Creating a New Application
31
Bare NetBeans Platform
32
Creating a New Module
33
Templates for NetBeans APIs
34
System FileSystem Registration
35
Editor
36
Samples
37
Overview of Generic Procedure
Start with a simple application. Compare what it is to what the
NetBeans Platform has. Create a new plugin project. Move the useful parts of our old
application to our new plugin. Run it.
38
Demo!
39
SummaryMany on the NetBeans PlatformNetBeans Platform gives plumbingMany APIs and libraries to help youNetBeans IDE provides toolsGetting started is easyMail list, tutorials, and training course
40
References
41
References
42
References
http://platform.netbeans.org/http://platform.netbeans.org/tutorials/
nbm-10-top-apis.htmlhttp://blogs.sun.com/geertjan/Your blog?
43
Questions & Answers