porting an application to the netbeanstm platform€¦ · > netbeans platform modules provide...

44
Porting an Application to the NetBeans TM Platform Geertjan Wielenga NetBeans Team Anton Epple Eppleton

Upload: others

Post on 10-Oct-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

Porting an Application to the NetBeansTM PlatformGeertjan WielengaNetBeans Team

Anton EppleEppleton

Page 2: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

2

AgendaIntroductionReal Life Porting ExperiencesDemo

Page 3: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 4: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

4

Page 5: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 6: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

6

Why Use NetBeans PlatformInstead of Eclipse RCP?> NetBeans Platform when creating Swing Applications> Eclipse RCP when using SWT

Page 7: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 8: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

8

What Are the Main Features & APIs?

> Window System > Action System> Dialogs & Wizards> Options & Settings> FileSystem & DataSystem> Internationalization> Help System

Page 9: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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... )

Page 10: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 11: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

11

What Are the Most Important Parts?> Dialogs API

● Based on java.awt.Dialog● Consistent display of standard messages● Customized messages● Elaborate Wizard Framework

Page 12: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 13: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 14: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 15: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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> ...

Page 16: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 17: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

17

Page 18: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

18

AgendaIntroductionReal Life Porting ExperiencesDemo

Page 19: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

19

Page 20: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

20

Nuance Voice XML

Page 21: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

21

Fiorano Studio

Page 22: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

22

Nokia Mobile Network

Page 23: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

23

Sketsa SVG Editor

Page 24: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

24

VisualVM

Page 25: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

25

AIOTrade

Page 26: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

26

JCae-CAD

Page 27: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

27

MC4J JMX Console

Page 28: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

28

JFugue Music NotePad

Page 29: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

29

StudioSL: Oil Flow

Page 30: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

30

Creating a New Application

Page 31: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

31

Bare NetBeans Platform

Page 32: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

32

Creating a New Module

Page 33: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

33

Templates for NetBeans APIs

Page 34: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

34

System FileSystem Registration

Page 35: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

35

Editor

Page 36: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

36

Samples

Page 37: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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.

Page 38: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

38

Demo!

Page 39: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

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

Page 40: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

40

References

Page 41: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

41

References

Page 42: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

42

References

http://platform.netbeans.org/http://platform.netbeans.org/tutorials/

nbm-10-top-apis.htmlhttp://blogs.sun.com/geertjan/Your blog?

Page 43: Porting an Application to the NetBeansTM Platform€¦ · > NetBeans Platform modules provide generic functionality, extension points and utility classes ... Base classes for advanced

43

Questions & Answers