NetBeans IDE & Platfrom API

kaputmaltwormΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 4 χρόνια και 4 μήνες)

326 εμφανίσεις

Gao Ang
Sun Mi cr os ys t ems, I nc.
Funct i onal Campus Ambas s ador

NetBeans IDE

& Platfrom API
Build Your Rich Client Application
2
Agenda


NetBeans IDE


NetBeans Platform


NetBeans Modules Architecture


NetBeans OpenIDE API


Rich Client Demo
3
What is NetBeans?


A comprehensive, modular
multi-lingual
IDE
(Integrated Development Environment)
>
Out-of-box support for Java SE, Java EE, Java ME
>
Large set of 3rd party modules (plugins)
>
Intuitive drag-and-drop development
>
Debugger, Profiler, Refactoring, etc...


A
platform
for building applications
>
RCP = Rich Client Platform
>
Rich client Java applications
>
Rich framework of windows, menus, tool bars, actions


A thriving
open source community
>
Open source since June, 2000
>
Large community of users and developers
4


Java SE Support - Swing GUI Builder, Javadoc integration, Support for JUnit 3 & 4


Java EE Support (1.3, 1.4 and 5) – first IDE to fully support Java EE 5


Java ME Support - Visual Mobile GUI Designer, Mobile Game Builder, etc.


Visual Web Development – Visual Web Editor, Visual Page Flow Editor, Visual Query Editor,
Visual CSS Editor, Database Explorer, etc.


Rich editing support - Smart Source Code Editor, Code Navigator, Code Completion/Folding,
Refactoring support


Profiler, Debugger, Version Control, etc.


Visual UML Modeling,


Netbeans Platform Development – Visual Library API, Rich Client Development, Lexer API, etc.


Highly Modular Architecture, Extensible with user contributed plugins


C/C++ Development


Dynamic Language Support – Ruby, Javascript, PHP, Groovy, Python, and more
Feature Overview
What is NetBeans?
5
What makes NetBeans the best?

Ant Based Project System

Friendly Editor

Powerful J2EE Support

Visual J2ME Development

An integrated Profiler

Collaboration tools
6
What makes NetBeans the best?
(cont.)

Spectacular GUI Buider (Project Matisse)

Refactoring support

CVS support

Java BluePrints Solution Catalog

Module Development Support

Update Center
7
Java EE Support
8
Java Mobile and UML

Profiler in NetBeans
10
NetBeans Projects Structure

Ant-based projects

Project file: build.xml

Can be extended

Ant tightly integrated
11
Dynamic Language on Netbeans (JRuby)
12
Ruby on Rails Support in NetBeans
13
Editable, Sortable Results, Multiple Result Tabs

Can sort the results by double-clicking on a row header, modify a row
14
Eclipse Importer to NetBeans
15
Start Using NetBeans
16
A Growing Ecosystem with more
than 150 partners!
17
NetBeans Platform

NetBeans Platform is a broad SWING-based
framework to create rich desktop applications

Platform provides out-of-the-box APIs to simplify
application common requirements such as window
management, menus, actions, settings and storage,
an update manager, and files access

Core of NetBeans-IDE is Platform ie. NetBeans-IDE
'minus' IDE specific modules
Build new desktop applications without re-inventing the wheel
18
NetBeans Platform Manager
NetBeans IDE 6.5 (Build 200811100001) (Default)
19
NetBeans Plugins Manager
20
Real World Demo of
NetBeans Platform
21
Blue Marine on NetBeans
22
23
https://visualvm.dev.java.net/
24
25
26
Demo Project:
JFugue Music NotePad

https://nbjfuguesupport.dev.java.net/
27
3
rd
Part API from community: Visual Library
28
29
Look Into
NetBeans Platform
30
The NetBeans Platform Arch


Existed before other RCP project


Advantages – platform indepandence,
code reuse, professional look


Possibility to define and choose
platform (can be different version IDE)


Packaging and branding (splash
screen, icons, etc.)


Distribution as zip or by java webstart
NetBeans
NetBeans
NetBeans
NetBeans
Platform
Platform
NetBeans
NetBeans
IDE
IDE
31
Platform Libraries
32
RCP Stuff Characteristics

Rich MVC

Lookup API

Publish and Subscribe
33


Bootstrap


Startup


Filesystem API


Module System API


Utilities API
NetBeans Runtime Container
The smallest runtime of Netbeans
34


Bootstrap—Enables the runtime container to understand what a
module is and how to load and compose them into one
application.


Startup—Provides the main method of your application, as well
as all the code needed for starting it up.


Filesystem API—Gives your application a filesystem.


Module System API—Lets you influence the lifecycle of the
modules in your application.


Utilities API—Includes many utility classes, especially the
Lookup class, which is used for communication between
modules.
Detailed Runtime Container
35
NetBeans APIs

Action APIs

File Systems APIs

Loaders APIs

Nodes APIs

Windows APIs

Palette APIs

Refactoring APIs

MultiView APIs

JavaHelp Integration APIs
NetBeans APIs in a Nutshell
http://platform.netbeans.org/tutorials/nbm-idioms.html
36
NetBeans APIs (cont.)

Action APIs
>
Package : org.openide.actions
>
Standard SWING and NetBeans API Actions

File Systems APIs
>
Package : org.openide.filesystems
>
Manipulating files on disk, and used indirectly by Loaders API

Loaders(Datasystems) APIs
>
Package : org.openide.loaders
>
Datasystems are the logical layer between a filesystem and
higher level file oriented operations. The API works on top of
file objects and gives each file a logical behavior – icon,
name, operation, etc.
37
NetBeans APIs (cont.)

Nodes APIs
>
Package : org.openide.nodes
>
The Nodes API controls the usage and creation of nodes,
which are a variant of Java Beans having adjustable property
sets; provide cookies and actions; formed into a hierarchical
tree.

Window System APIs
>
Package : org.openide.windows
>
Window API allows module to provide window-like
components, mainly through embeddable visual components
called topcomponents. A top component is a SWING
component and need to be docked to be manipulated by the
window system.
38
Five Steps
Module Development
in NetBeans
39
About NetBeans Module (NBM)

Packaged for delivery via the web

NBM files:
>
Are compressed
>
Can contain multiple JARs
>
Contains metadata NetBeans uses to display information
in the Update Center
>
Typically signed (using JDK mechanism for JAR signing)

Just zip files with a special extension
40
About NetBeans Module (cont.)

A NetBeans Module
>
JAR written to interact with the NetBeans APIs.
>
Identified by an entry in its MANIFEST.MF
>
Packaged as NBM files (.nbm extension)

Used to:
>
Build a stand-alone application
>
Extend the IDE
41
Module Development in Netbeans

Create module from a template

Create module “suites”

Build/run/debug within the IDE

Hot-redeploy modules

Debug "fix and continue" (hotswap) for modules

http://platform.netbeans.org/
42
Step No.1: Project Templates

Module Suite Project
>
Application Struction

Module Project
>
Wrap functionality

Library Wrapper Module Project
>
Wrap external JAR

NetBeans Platform Application
>
It is the starting point for
your rich-client applications.
43
Step No.2 API Templates

Action
>
Creates an action that can be
invoked from a menu item,
pop-up menu, toolbar button,
or keyboard shortcut

Window Component
>
Creates a new window with an
Open action invoked from a
menu item.
44
Step No.2 API Templates (cont.)

File Type
>
Let's the IDE recognize a new file type

Wizard
>
Wizard for generating wizard sketeton...

Project Template
>
For adding new templates and samples

J2SE Library Descriptor
>
Adds new JARs to the IDE's Library Manager
45
Step No.2 API Templates (cont.)

Options Panel
>
Extend the Options window

JavaHelp Help Set
>
Wizard setting up JavaHelp help set

Update Center
>
Support your distribution process

Module Installer
>
Before the application begins - initialization
46
Step No.3 Develop the Module

Use the NetBeans Source Editor

Refer to the NetBeans OpenIDE API Javadoc
47
Step No.3 Develop the Module

http://platform.netbeans.org
>
Quick Start Guide, FAQ, Tutorials
48
Step No.3 Develop the Module

Matisse! Matisse! Matisse!
49
Step No.4 Build, Install and Debug

Build Main Project

Run Main Project
>
Install in target Platform
>
Install in Development IDE

Create NBM
50
Step No.5 Brand & Distribute

Module Projects
>
Create NBM
>
Distribute and install via the Update Center

Module Suite Projects
>
Brand (launcher name, splash screen, progress bar, title
bar)

Build ZIP Distribution

Build JNLP (Web Start)
51
So the module development is...

Create a rich-client application skeleton

Bundle a 3rd party API

Add a module for functionality

Design and code the module

Create a distribution
52
Helpful Tips to
NetBeans Platform
53
API Changes

http://bits.netbeans.org/dev/javadoc/apichanges.html
54
NetBeans API List

http://bits.netbeans.org/dev/javadoc/index.html
55
SVN Repository
56
Continuous Integration Engine
57

NetBeans Product Site:
http://www.netbeans.org
>
Download: previews, current & past releases of IDE, plugins
>
Learning: tutorials, technical articles, flash demos
>
Community: latest news, forums, events, mailing lists

NetBeans Wiki:
http://wiki.netbeans.org/wiki/
>
Open-source documentation site for NetBeans

Planet NetBeans:
http://www.planetnetbeans.org/
>
Aggregate for all NetBeans-related blogs

Source Code:
http://www.netbeans.org/community/sources/hg.html
>
Mercurial source code access for Netbeans platform + IDE
Next Steps
NetBeans 6.5 Resources
58
Need Help?

dev@openide.netbeans.org

http://platform.netbeans.org
http://blogs.sun.com/geertjan/
Gao Ang
Sun Mi cr os ys t ems, I nc.
Funct i onal Campus Ambas s ador
THANK YOU!