Java Netbeans - Desktop Application Architecture
Java Netbeans - Desktop Application Architecture
SM
1 | 2004 JavaOne Conference | Session TS-1694
Write Rich Desktop Apps
While Saving Time and Money
SM
2 | 2004 JavaOne Conference | Session TS-1694
Agenda
SM
3 | 2004 JavaOne Conference | Session TS-1694
The Need for Rich Desktop Clients
SM
6 | 2004 JavaOne Conference | Session TS-1694
Modularity of Components
Its importance for good UI application
• Discipline: Developers write cleaner code
• Final assembly of application is independent
• Solutions tailored to customer needs
• Much tighter UI tasks flow
Module
Module
Module
Module
Module
Application
Application
Application
Platform
SM
= UI task flow
7 | 2004 JavaOne Conference | Session TS-1694
Modularity in NetBeans
Modify your application to be NetBeans IDE module
• Module is any JAR file with enhanced manifest
Manifest-Version: 1.0
OpenIDE-Module: org.netbeans.modules.text/1
OpenIDE-Module-Specification-Version: 1.13
SM
8 | 2004 JavaOne Conference | Session TS-1694
Modularity in NetBeans
Dependencies between modules
OpenIDE-Module-Specification-Version: 1.13
OpenIDE-Module-Provides: EditorImpl
OpenIDE-Module-Module-Dependencies:
org.netbeans.api.spellchecker/1 > 1.3,
org.netbeans.core > 4.32
OpenIDE-Module-Requires: SpellImpl
• Types of modules
─ Regular
─ Autoload
─ Eager
SM
9 | 2004 JavaOne Conference | Session TS-1694
Modularity in NetBeans
Module Enablement and ClassLoader Hierarchy
• Dependencies influence runtime classpath
• A module can turn other modules on
org.netbeans.modules.text/1
Provides: EditorImpl org.netbeans.spellimpl
Requires: SpellImpl Provides: SpellImpl
Autoload
org.netbeans.api.spellchecker/1
org.netbeans.core
SM
10 | 2004 JavaOne Conference | Session TS-1694
Cooperation of Modules
Composition of UI Elements
• Menu, toolbar elements
─ Get merged together by the NetBeans framework
• Windows layout
• Registration solved by Layers
<folder name="Menu" >
<folder name="File" >
<file name="Open.instance" >
<attr instanceCreate=
"org.openide.actions.OpenAction" />
</file>
</folder>
</folder>
SM
11 | 2004 JavaOne Conference | Session TS-1694
Cooperation of Modules
Composition of Menu <folder name="Menu/File">
<file name="NewProject.instance" />
<file name="ImportProject.instance" />
<file name="Separator.instance" />
<file name="OpenProject.instance" />
<file name="OpenRecent.instance" />
<file name="CloseProject.instance" />
</folder>
<folder name="Menu/File">
<file name="NewFile.instance" />
<file name="Open.instance" />
</folder>
<folder name="Menu/File">
<attr name="NewProject.instance/NewFile.instance" boolvalue="true" />
<attr name="NewFile.instance/ImportProject.instance" boolvalue="true" />
<attr name="OpenProject.instance/Open.instance" />
<attr name="Open.instance/OpenRecent.instance" />
</folder>
SM
13 | 2004 JavaOne Conference | Session TS-1694
Cooperation of Modules
Exposing Window State
class MyWindow
extends org.openide.windows.TopComponent {
private JEditorPane pane;
SM
14 | 2004 JavaOne Conference | Session TS-1694
Cooperation of Modules
Querying and Listening to State
import org.openide.util.Utilities;
SM
15 | 2004 JavaOne Conference | Session TS-1694
Cooperation of Modules
Generic Viewer—Explorer
• Presentation of tree hierarchies
─ Not only tree view, but many others
• Each Node has its own context
─ Can be queried and observed
• Modules can contribute to the hierarchy
SM
16 | 2004 JavaOne Conference | Session TS-1694
Branding and Customization
SM
17 | 2004 JavaOne Conference | Session TS-1694
Rich Unger
SM
18 | 2004 JavaOne Conference | Session TS-1694
What Is V-Builder?
Voice User Interface (VUI) IDE
• Design telephone conversations
between a human and a computer
• Edit many file types
─ Call-flow design
─ Prompt (.wav)
─ Grammar (linguistic regular expression)
─ VoiceXML
• Run the application using vocal or
textual interactions
SM
19 | 2004 JavaOne Conference | Session TS-1694
What Is V-Builder?
SM
20 | 2004 JavaOne Conference | Session TS-1694
Challenges
• 5 developers
• IDEs not our core competency
─ VUI experts, not GUI experts
• High customer expectations
─ Source control
─ Syntax coloring/completion
─ Easy enough for non-programmers (and yet, speech
recognition is very complicated)
SM
21 | 2004 JavaOne Conference | Session TS-1694
Solution:
Netbeans Platform
Gives You
Free Stuff
SM
22 | 2004 JavaOne Conference | Session TS-1694
Source Control (VCS)
• Use org.openide.filesystems.FileObject
instead of java.io.File
─ Similar API
─ Wraps access in redirection layer
• Free support for multiple source
control systems
─ CVS
─ Subversion
─ SourceSafe
─ ClearCase
─ PVCS
SM
23 | 2004 JavaOne Conference | Session TS-1694
XML Editor
Declare a new MIME type
VoiceXMLDataLoader.java:
return null;
}
SM
24 | 2004 JavaOne Conference | Session TS-1694
XML Editor
SM
25 | 2004 JavaOne Conference | Session TS-1694
Source Editor
GSL Files—a text file with a unique syntax
• Declare an org.netbeans.editor.Syntax subclass
(for completion and coloring)
• Add an EditorSupport cookie
SM
26 | 2004 JavaOne Conference | Session TS-1694
Context-Sensitive Help
Uses JavaHelpTM API
public HelpCtx getHelpCtx() {
return new HelpCtx(MyClass.class);
}
SM
27 | 2004 JavaOne Conference | Session TS-1694
Other Stuff...
• Update Center
• Templates
• Wizards
• Task list
• ANSI terminal
• ... And on, and on...
SM
28 | 2004 JavaOne Conference | Session TS-1694
Demo
Nuance V-Builder
SM
29 | 2004 JavaOne Conference | Session TS-1694
André Eickler
SM
30 | 2004 JavaOne Conference | Session TS-1694
What Is NetAct?
Nokia’s product for managing mobile networks
• Manages thousands of network elements,
tens of network element types, tens of vendors
• Contains configuration, monitoring,
reporting, planning, ...
BTS BSC
HLR/AuC
MSC/VLR EIR/SMSC
SM
31 | 2004 JavaOne Conference | Session TS-1694
What Are NetAct’s UI Challenges?
Seamless integration of large numbers
of management tools
• More than 70 user interface applications
in Nokia’s product (plus other vendor’s
applications)
• Daily management procedures easily
involve ten or more graphical tools
• Procedures vary largely between
network operators
SM
32 | 2004 JavaOne Conference | Session TS-1694
What Is NetAct’s Solution?
NetAct Desktop = NetBeans + J2EE + Navigation
• NetBeans Platform
─ Module concept, window system, ...
─ JFC/Swing compatibility (porting existing
Uis, third-party software)
• J2EE platform client support
─ Java Web Start software support
─ ...
• Navigation goodies
─ ExtensibleNode
─ Bookmarks
SM
33 | 2004 JavaOne Conference | Session TS-1694
Screenshot
SM
34 | 2004 JavaOne Conference | Session TS-1694
Java Web Start Software Support
Integration with NetBeans module system
• Module discovery servlet
─ Find all deployed NetBeans modules on a server
─ Dynamically generate JNLP file
• Classpath workaround
─ Java Web Start breaks NetBeans’ module system
by making all downloaded classes visible
─ All files in module jars get prefixed by a directory
to make them “invisible”
─ E.g., class "org.netbeans.api.enode.ExtensibleNode"
becomes
"enode/org/netbeans/api/enode/ExtensibleNode.class"
─ Special classloader resolves access to classes
SM
35 | 2004 JavaOne Conference | Session TS-1694
http://installer.netbeans.org/docs/jnlpInstaller2.html
Extensible Node
Simple pluggable navigation feature
• Modules declare actions offered for
particular nodes as part of their Layer file:
<folder name="ExtensibleNode" >
<folder name="Actions" >
<folder name="Network Element">
<file name=
"com-nokia-oss-ResetAction.instance"/>
</folder>
</folder>
</folder>
SM
37 | 2004 JavaOne Conference | Session TS-1694
http://contrib.netbeans.org/source/browse/contrib/bookmarks/
Bookmarks
SM
38 | 2004 JavaOne Conference | Session TS-1694
Demo
NetAct Desktop
SM
39 | 2004 JavaOne Conference | Session TS-1694
NetBeans Has All You Need to Efficiently
Develop Integrated Rich Clients
Visit http://www.netbeans.org
Visit http://www.nuance.com
Visit http://www.nokia.com
40
Get free stuff from the Nokia booth, 1415
SM
| 2004 JavaOne Conference | Session TS-1694
Q&A
André Eickler, Nokia
Jaroslav Tulach, Sun Microsystems
Rich Unger, Nuance
SM
41 | 2004 JavaOne Conference | Session TS-1694
How to Simplify Building
Rich Clients in the Java™
Programming Language java.sun.com/javaone/sf
SM
42 | 2004 JavaOne Conference | Session TS-1694