

NetBeans: The Definitive Guide (e-book)



NetBeans: The Definitive Guide (e-book) - Najlepsze oferty
NetBeans: The Definitive Guide (e-book) - Opis
As the Java programming language has increased in both functionality and complexity, developers have demanded more of their program editors. Gone are the days when a simple visual editor is sufficient for even small programming projects. While there are numerous IDEs available today for use by Java developers, one stands above the rest, not only for its functionality, but for its extensibility: NetBeans.In NetBeans: The Definitive Guide, you'll find out how to use this IDE to its fullest, making your Java programming more efficient and productive than ever before. You'll understand the basics of the IDE, and quickly be utilizing the various editor and explorer windows. You'll also master many of NetBeans advanced features, and be working with XML documents, CVS repositories, Javadoc trees, and web applications, all within the NetBeans framework.In addition to teaching you how to use the existing features of NetBeans, this work goes on to cover developing additional modules for NetBeans. Through this instructional portion of the book, you will master the NetBeans APIs, and learn how to enhance NetBeans for your own specific needs. Whether you need to add customized behavior to handle your proprietary file formats, or want to redistribute NetBeans as a proprietary product, NetBeans: The Definitive Guide will allow you to master this open source IDE and all of its advanced features. Whether you are an enterprise developer looking for an IDE that can handle your complex program tasks, an open source developer looking to integrate NetBeans into your own visual projects, or a (...) więcej manager trying to maximize your team's development potential,NetBeans: The Definitive Guide is the book for you. Spis treści:NetBeans: The Definitive Guide
SPECIAL OFFER: Upgrade this ebook with OReilly
A Note Regarding Supplemental Files
Preface
Is NetBeans for You?
Is This Book for You?
NetBeans and Java
What Is JavaBeans?
The Core Concept of NetBeans
NetBeans as the Visual JDK
All the Usual Features
NetBeans as a Tools Platform
NetBeans as an Open Source Community
Dont Be Cross that This Book Is Cross-Platform
Contents of the Accompanying Sources
Licensing of the Code Examples in This Book
Writing Conventions in This Book
Comments and Questions
Acknowledgments
Reviewers
Simeon Greene
Vaughn Spurlin
Jack Woehr
Jesse Glick
Tim Boudreau
1. Getting and Installing the IDE
Platforms and Requirements
What Are the System Requirements to Run NetBeans?
Getting and Installing a JDK
The Java Development Kit
Relationship of JDK to JRE
Obtaining the JDK
What JVM flavors and version are known to be supported by the IDE?
Which IDE Distribution?
Installing Binary Distributions
Building the IDE from Source (Simple Builds)
What Youll Need to Build the IDE
Setting Up and Performing the Build
Where Did Everything Go?
How Do I Install a Newly Built Version of NetBeans?
Running the IDE
Minimal Environment
How to Launch NetBeans
Switches to the runide.sh script
Multiple NetBeans Users
Troubleshooting
Launching
X Window System issues
Appearance once launched
Screen resolution
X Window System
SDI vs. MDI
Summary regarding windowing issues
Updating the IDE Automatically
The Update Center
Configuring the Update Center
Setup Wizard
Youre Now Running NetBeans
2. Concepts and Paradigms
NetBeans and the Java Abstract Model of Computing
Explorer
Objects in the User Interface
Data Objects, Nodes, Actions, and Properties
What has NetBeans Explorer got to hide?
Other file types
Tabs in the Explorer
The Filesystems view
How to mount and unmount JARs and directories
The Project view
The Javadoc view
The Runtime view
Node Paradigms
Explorer views of Java classes
Badges
Expanded view of classes
Cut, copy, and paste subnodes
Tools actions
Sometimes Explorer Gets Behind the Times
Does a file really need recompilation?
Is a version really up to date? Is a file really local or is it already in the repository?
Summary
Filesystems and the CLASSPATH
How branches of the host filesystem manifest themselves in NetBeans
How CLASSPATH is handled in the IDE
How to modify the IDEs CLASSPATH
Appending and prepending CLASSPATH to the IDEs CLASSPATH
Other CLASSPATH tricks
Creating Packages and Classes
Creating Packages
Creating Classes
Templates
Using templates
Creating templates
Creating your own macros
Services
Compiler Services
Compiling your code
Compiler settings
Execution Services
Debugging Services
Workspaces
Editing
GUI Editing
Browsing
Running
Debugging
Persistence Across Sessions
Using Multiple Instances of Explorer
Using Multiple Instances of the Source Editor
Project Management
Managing Multiple Projects
Managing Project Builds Using Ant
Object Browser
Summary
3. Working with the Source Editor
Why Learn a New Editor?
Opening the Source Editor
Context Menus
Closing the Source Editor
Code Completion
Using Code Completion
Taking advantage of code completion
Avoiding code completion
Updating the Parser Database to Include New Classes
Abbreviations
Editor Colorings
Shortcuts
Word Matching
Indentation Engines and Code Formatting
Automatic Edits
Other Editor Functionality
A Simple Example
4. Debugging
Debugger Types
Breakpoint Types
Adding and Removing Breakpoints
Setting Watches
Starting the Debugger
The Debugger Window
The Variables View
Remote Debugging in NetBeans
Debugging Remotely
Caveats
Advanced Features
5. Compilation and Execution Services
Using Custom Compilation and Execution Services
Creating and Customizing Internal Compilation Services
Creating and Customizing External Compilation Services
Creating a new JDK 1.1 External Compilation Service
Configuring the new JDK 1.1 External Compilation Service
Configuring the external process
The Internal Execution Service
Creating and Customizing External Execution Services
Associating Services with Java Files
Setting Default Services for Java Files
Setting Services for Specific Files
Building with Ant
Creating a Build Script
Configuring the Ant Module
Executing and Compiling with Ant Scripts
Why Use Ant?
6. Customizing the Environment
The Setup Wizard
General NetBeans Settings
Module Installation
Update Center
The ToolsOptions Dialog
Configuring Toolbars
Configuring Menus
Configuring Editors
Object Type Associations
Editor Settings
Global Key Bindings (shortcut keys)
Fonts and colors
Macros
Recording and saving macros
Editing and executing macros
Indentation engines
Command Line Options
Modules
Installing Modules
Installing from the Web
Installing manually downloaded NBM files
Enabling and Disabling Modules
7. Using Source Control (CVS)
What Is CVS?
The How, When, and Why of CVS in NetBeans
When to Use CVS
Where to Get a Client
NetBeans and CVS
Using Generic VCS
Using Command-Line CVS Support
CVS and NetBeans Projects
New Files and Packages
CVS Outside of NetBeans
Mounting CVS Sources
Exploring Versioned Sources
Common CVS Operations
Checkout/Get
Checkin and Commit
Add and Import
Log
Diff
Update
Unexpected Results
Spurious [Local] Designation
Adding Directories
Adding Binary Files
Uncommon CVS Operations
Branching, Merging, and Tagging
NetBeans CVS and the Secure Shell (SSH)
Mounting a Generic Versioning System
One Final Tip
8. GUI Building
Creating a GUI Frame or Panel
Adding Components to a GUI Container
Configuring Components
Building Menus
Changing a Containers Layout
Working with Borders
Accessibility
Copying a Source Object
The Connection Wizard
The GridBagLayout Customizer
Adding Event Handlers
Using the Code Generation Properties
Working Around Code Generation
Containers Within Containers
Building Complex GUIs
9. JavaBeans
Why Should I Make Beans?
Creating JavaBeans
Creating a GUI Component
Converting a GUI Component into a Bean
Adding an Event Set to a Bean
Generating a BeanInfo Class
Adding a Design-Time Icon
Component Palette
Adding a Category to the Component Palette
Adding a Bean to the Component Palette
Component Palette Problems
10. Using Javadoc
Javadoc Support in NetBeans
Mounting Javadocs
The Javadoc Search Tool
Creating Javadoc
The Auto Comment Tool
Javadoc filtering
Viewing, editing, and correcting Javadoc comments
Javadoc Generation
Javadoc Search Types
Javadoc Executors
Doclets
Adding content
Adding links
Customizing the HTML format
Additional properties
11. Working with XML
Installing XML Support
Overview
Templates
Browsing and Editing
Generating Documentation
Accessing with Java
XML Schema Support
XML Editors
Beyond Editing XML
Checking and Validating XML
Setting the Node View
Generating a DTD
Generating Documentation
Generating CSS
Generating Java Classes
Generating a SAX Document Handler
Generating a DOM Tree Scanner
12. Developing Web Applications
Why the IDE Supports Web Application Development
How the IDE Provides Web Application Support
Creating a Web Application
The Filesystems View
The Web Project View
Working with JSP and HTML Files
Advanced Web Applications Features
Executing Web Applications
Working with Servlets
Viewing JSPs as servlets
Adding servlets
Adding a new servlet
Adding an existing servlet
Executing servlets
Passing request parameters
Packaging and Deploying Web Applications
Deploying Web Applications
Configuring Tomcat
13. Extending NetBeans
Whats Different About NetBeans?
The Core and the Open APIs
The License
Open Source
The netbeans.org Web Site
Registration
Bug tracking
Ways to participate
The netbeans.org FAQs and mailing lists
NetBeans for Bean Counters
Getting and Installing the Open APIs Support Module
Life Is Change
Source Code for the Examples
14. Understanding the NetBeans APIs
Design Philosophy of NetBeans
Abstracting the Abstractionsthe Open APIs
Modularity
Hierarchy, Files, and Nodes
Everything Is a FileVirtually
Mapping Files to Java Objects
The System Filesystem
Module Layers
Layers in the System Filesystem
Exploring the System Filesystem
Data ObjectsWrappers for Persistent Data
NetBeans and JavaBeans
Nodesthe Application as Hierarchy
Presenting Nodes to the UserExplorer
User-Level Customization
Nodes in Action
Adding to the Component Palette using Paste Link
Rearranging actions/toolbar contents/menu contents
Pasting a compiled class to a menu and executing it from there
ModulesOverview
How Modules Add Functionality
How Modules Install Virtual Filesystem Layers
What Modules Can Do
Disabling Modules
An IllustrationNetBeans with No Modules
Interacting with the IDE
Setting the Status Bar Text
Setting the Current Workspace
15. The Open APIs
APIs versus Core versus Modules
Service Provider Interfaces and Client APIs
Overview of the APIs and Their Purposes
Modules
Module manifests
XML layers
Ordering files in XML layers
Lookup and the Services API
Lookup, .settings files, the system filesystem, and layers
Commonly used or interesting classes in this package
Services
Nodes
Commonly used or interesting classes in this package
Datasystems
Explorer
Actions
Options
Compiler
Editor
Windowing System
Cookies
Cookies and supports
Execution
Java Hierarchy
Filesystems
Modules, JARs, and Class Loaders
Threading, Deadlocks, andHow to Avoid Them
16. Developing Modulesthe New Module Wizard
The HelloWorld Module
Creating a Module Using the New Module Wizard
The Source Files
17. Internals of the Running IDE
The Activated Node(s)
Cookies
A Peek under the Hood
Touring NetBeans with the Bean Browser
Data Objects, Nodes, and Cookies
Filesystems and the Repository
Services
Lookup
Options
UI Components
TopComponents, Modes, and Workspaces
Browsing the window system in the system filesystem
XML format for workspaces, modes, and components
Actions
Presenters
Custom Property Editors
Localization
Wizards
Jumping-off Places
Special Folders in the System Filesystem
18. Creating the QuickPanel Module
Abstractions Covered in This Chapter
Creating the Project Files Drop-Down
FilterNodeFiltering Which Children of a Node Are Displayed
Creating the Methods Drop-Down
Improving the Methods Drop-Down
Creating the Module
Creating a Container GUI Component
Creating the ShowQuickPanelAction
Creating the XML Filesystem Layer
Creating and Populating the Module JAR
Building and Testing the Module
A Little Homework
19. A Mail-Based Filesystem
Building a Mail Reader in the NetBeans Paradigm
Implementing MailFileSystem Using AbstractFileSystem and JavaMail
Creating a New AbstractFileSystem Implementation
Mail Filesystem: AbstractFileSystem.Info
Mail Filesystem: AbstractFileSystem.List
Mail Filesystem: AbstractFileSystem.Change
Mail Filesystem: AbstractFileSystem.Attr
Other Parts of AbstractFileSystem
Creating Folder Objects for Attachments
Using FileSystem.Status Annotations to Mark Unread Messages
BeanInfoDisplaying Filesystem Properties
Using the Wizard Framework to Set Up Mail Accounts
Creating Wizard Classes
The IMAP Mail Server Template Wizard
20. Creating the User Interfacefor the Mail Client
Creating a DataLoader for Messages
Displaying and Editing Simple Messages and Unnamed Attachments
Handling Multipart Messages
Creating a Threaded Mail View Using Filter Nodes
Making a Basic Mail View
Making a Threaded Mail View as an Alternative
Creating a Mail Workspace
21. Score File Support
OverviewFunctionality to be Implemented
Creating the Minicomposer Module
Creating the Manifest
Creating the Layer
Creating a JAR File Using Ant
Creating a UniFileLoader and MultiDataObject for *.score Files
Creating an Editor Support for Scores
Creating a Fixed ExecCookie to Play Scores
Creating a Simple Template
22. Creating a Structural View of the Score
Creating a ScoreCookie to Represent a Sequence of Notes
Examples of State-Based Supports
Creating a ScoreSupport
Why a Document Is Used
Implementation of ScoreSupport
Lifecycle of the Score
An OpenSupport
Creating an OpenCookie Implementation
Showing a GUI View of the ScoreCookie
Indicating Parse Errors on the Node
23. Compiling Scores
Creating the Compilers
Creating and Using the Compiler Cookie
Displaying an Out-of-Date Badge on Score Icons
24. Executing Scores
Creating the .au Player Executor
The Internal Player
The External Player
Registering the Players as Services
Creating Player Configuration Support
Creating a SystemOption for the Default Executor
25. Better Score Support in the Explorer
The Clip Length Property
Clearing the Cache and Firing Changes
Adding the Property to the Property Sheet
Representing Notes as Subnodes Using Children.Keys
Using Keys to Model Children
Being Lazy and Cleaning Up
Creating the Subnodes
Attaching the Children to the Parent
Permitting Subnodes to Be Renamed or Deleted
Deletion of Notes
Renaming of Notes
Permitting Subnodes to Be Added
Making Read/Write Properties on Subnodes
Reordering Subnodes
Data TransferCut, Copy, and Paste of Notes and Sequences
Overview of the Transferables
Cutting and Copying
Pasting
Drag & Drop
Converting Score Text, Text Score, Several Scores One
26. Tuning Modules for Performance & Memory Footprint
Startup Performance vs. Runtime Performance
Operating Principles
Nobody Will Ever Use My Module
What Does My Module Really Need to Do on Startup?
What Are the Critical Paths?
Techniques
Lazy Initialization
Avoid Static Initializers
Avoid ModuleInstall ClassesUse XML Layers Instead
.settings files
Batching results of expensive operations
Partial Loading ConsiderationsInstanceCookie and InstanceDataObject
Use URLs Instead of CDATA Sections in XML Layers
Reduce the Number of Classes You Create
GUI ComponentsWait for addNotify( )
Using the addNotify( ) and removeNotify( ) Pattern Where Exposed by Non-GUI Classes
Use Weak and Soft References for Objects
Utility classes that can help
Use WeakListener
Avoid Excessive Event Firing
Avoid Overuse of Threads
Batching Events
Swing Performance
27. Producing Modules (Packaging & Distribution)
Versioning
Version Numbers and What They Mean
Specifying Dependencies
Managing Inter-Module Dependencies
Routine and compatible upgrades
Incompatible upgrades
Module dependencies and relative order
Upgrading User Settings
Settings History and Physical Format
Upgrade Scenarios for Settings
Serialized settings
Templates and saved files
Actions
Window system elements and custom formats
What Happens When a Module Is Disabled?
User Development Data
Bundling Extension Libraries
Referencing Libraries with Class-Path
Using Autoload Library Modules
Ad-Hoc Resources and Module Installer Validation
Internationalization and Accessibility
I18N and L10N
A11Y
JavaHelpWriting and Distributing
Creating a Help Set
Adding a Help Set to NetBeans
Adding Context Help
Separating Help from Code
Supporting User-Level Java APIs
Supplying a Parser Database
Bundling Javadoc
Adding to the Default Classpath
Templates
Bean Installation
Creating the Module JAR File Within the IDE
Creating a Build Script Using Ant
Producing the .nbm File
Publishing Using the Update Center
Using ErrorManager to Log Problems
Testing
28. Building Your Distribution of NetBeans
Do You Need Your Own Distribution?
Licensing
Selecting a Baseline
Getting the Sources
Customizing the Build Process
Adding Modules to a Stock Distribution
Creating Preconfigured Settings
Branding
Implementing Branding on a Distribution
Simple Branding: Text Strings and Images
Configuration Branding: Menu Bar, Workspaces, and More
Replacing a file
Adding a file
Removing (masking) a file
Using the Open APIs Support to brand layers
Advanced Branding: Patching Behavior
A. A Tour of Existing Modules
Modules That Expose Functionality You Might Need
The XML Modules
The Editor
Version Controlthe VCS Core Module
RemoteFS
The Ant Module
The Java Module
Debugger Core
J2EE Server
Form Editor
HTTP Server Module
Classfile Reader Module
The Metadata Repositorya Whole Host of APIs
Socket-Based Editor Supportthe External Editor Module
Incidental APIs, Utilities, and Extensions
The Utilities Module
API Extensions (openidex)
Modules That Make Good Examples for Things You May Need to Implement
Annotations and Dynamic Editor Tool Tipsthe Ant Module and the Debugger Core Module
Adding Information to the View of Java Sourcesthe Beans Module
Adding a Debugger Typethe Applet Module
Multiplexing DataObjects and Complex Cut/Copy/Paste Supportthe Properties Module
Working with Network Protocols to Access FilesJavaCVS and RemoteFS
Domain-Specific XML Supportthe Tomcat and Ant Modules
Stretching the Limitsthe Web Modules
Complex Syntax Coloringthe JSP Module
Multi-Stage Compilationthe JSP, RMI, and CORBA Modules
Bridging to an Entirely Different Build Systemthe Ant and Makefile Modules
Use of the Compiler Infrastructure for Non-Compilation Tasksthe JAR Packager Module
Executionthe Applet and JSP/Servlet Modules
Custom Hyperlinking in the Output Windowthe Ant Module
Specifying Windows, Workspaces, and Components Using XMLthe Core Window System and the Form Editor Module
Complex Work with MIMEResolvers and Multi-File DataObjectsthe CPP Module
Cut/Copy/PasteData Transfer Support for Complex Elementsthe Ant and Java Modules
Interconversion between Different Types of Clipboard ContentsJNDI, CORBA, and RMI
Integrating Other Programming Languagesthe C++/Fortran, Scripting, and WebL Modules
Fancy Footwork with Nodesthe Java Module
Adding Nodes to the Runtime Tab in the Explorerthe RMI, CORBA, JNDI, and Database Explorer Modules
The Bare Essentials of Non-Data-Driven Nodesthe System Properties Module
Wizardsthe CORBA, Java, and New Module Wizard Modules
Embedding Property Panels into Wizardsthe Java Module
Complex Explorer Viewsthe Debugger Core Module
Enabling/Disabling Sets of Actions Based on Contextthe VCS Core Module
B. Useful Utility Classes
XML Utilities
org.openide.xml.XMLUtil
org.openide.xml.EntityCatalog
Visual Components and Extensions to Standard Swing Components
Lookup Implementations
Threading
Miscellaneous Utility Classes inorg.openide.util
Serialization Helpers
C. Resources
CVSHome
GNU/BSD/Other Operating Systems
CVS GUI Clients
Java Environments
Java Tools
Apache Software Foundation
Secure Shell (SSH) Resources
Cygwin for Windows
Newsgroups and Mailing Lists
Web Sites
Organization of Main NetBeans Web Site
Sun Sites
NetBeans Open Source Projects with Design Forms in the Distribution
Java-Oriented IDEs Other Than NetBeans
D. Future Plans
Declarative Instantiation
Uniform Lookup
Datasystems II
The Looks API
Declarative Actions
Deprecation of IDE-Specific Functionality in the Open APIs
The Metadata Repository
Standards Employed by the MDR
Project Support
E. Working with Open Source and NetBeans
Practices
Governance
Consensus
The mechanics of consensus
How to Get Involved
The mechanics of contribution
The Lifecycle of Module Development
Resources
CVS (Concurrent Versioning System)
Projects
Mailing Lists
CVS mailing lists
Issue mailing lists
Issuezilla
Interacting Effectively on Mailing Lists
F. Additional Modules and Where to Find Them
Open Source Modules Available Via the Update Center
The Modules Marketplace on Flashline
IDEs That Are Distributions of the NetBeans IDE
Open Source Application Projects Based on NetBeans
Commercial Applications Built on the NetBeans Platform
Commercial Modules Available for NetBeans
Should You Create Your Own Update Server?
Index
About the Authors
Colophon
SPECIAL OFFER: Upgrade this ebook with OReilly mniej
NetBeans: The Definitive Guide (e-book) - Opinie i recenzje
Na liście znajdują się opinie, które zostały zweryfikowane (potwierdzone zakupem) i oznaczone są one zielonym znakiem Zaufanych Opinii. Opinie niezweryfikowane nie posiadają wskazanego oznaczenia.