blob: a82bb48d5a93c96eddb969df52ee3194b418af43 [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqApisBasics
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqApisBasics
:description: Apache NetBeans wiki DevFaqApisBasics
:toc: left
:toc-title:
:syntax: true
=== What are the basic things I should know about NetBeans' architecture to get started creating NetBeans Platform applications?
The most important thing you need when creating applications on top of the NetBeans Platform (a.k.a. NetBeans RCP) is to know what you are trying to do clearly, so you can find what you need to get started quickly. Here are some basic NetBeans factoids which will either answer some questions or whet your appetite for more information:
* A module is a JAR file with some special manifest entries. The NetBeans IDE (5.0 and up) has lots of support for building modules.
* Modules usually affect the system by putting entries in an link:DevFaqModulesLayerFile.asciidoc[XML file] inside their JAR, which the system reads.
* You can link:DevFaqActionAddMenuBar.asciidoc[add] to, remove from, change or completely remove menus from the main window, toolbars and other things from a module
* To show your own tabs in the main window, you will want to subclass link:DevFaqWindowsTopComponent.asciidoc[TopComponent]
* The windowing system provides facilities for link:DevFaqTrackingExplorerSelections.asciidoc[tracking selection], and actions can be made sensitive to selection. Selection typically centers around use of link:DevFaqWhatIsANode.asciidoc[Node]s; it is also possible to have link:DevFaqTrackGlobalSelection.asciidoc[context sensitive actions without Nodes].
* It is possible to build tree and other views of objects very quickly using link:DevFaqWhatIsANode.asciidoc[Node]s in conjunction with link:DevFaqExplorerViews.asciidoc[Explorer Views]
* Many pieces of NetBeans UI are really views of some folder in the link:DevFaqSystemFilesystem.asciidoc[configuration filesystem] which modules install things into
* The link:DevFaqSystemFilesystem.asciidoc[configuration filesystem] is read-write, and changes can be saved to the link:DevFaqUserDir.asciidoc[user's settings directory]
* Applications built on NetBeans do not have to be IDE-like - there is plenty of support for editing files available in the Editor module and friends, but you do not even have to include those modules in your application if you do not use them
A lot of things in NetBeans are based around _file recognition_ and using files to provide Java objects. Even if your application has nothing to do with editing files, this may still be very useful to you, since the same mechanism that recognizes/displays a user's files on disk also recognizes/displays configuration data (which may not even be files in the traditional sense at all), and such "files" can actually be factories for whatever kind of object you want (and that way you get persistence of those files for free).
For example, the link:http://platform.netbeans.org/tutorials/nbm-feedreader.html[FeedReader tutorial] simply serializes POJO Feed objects into the link:DevFaqSystemFilesystem.asciidoc[configuration filesystem ], and its whole UI consists of aiming a standard tree component at a folder full of those objects, and providing a few actions to let the user create more of them. When the application shuts down, it does not need to any special code for persisting them, it is all automatic.
For more information about how that works, see link:DevFaqFileRecognition.asciidoc[the section on file recognition].
One of the most basic and important things to know about is link:DevFaqModulesGeneral.asciidoc[how modules register objects] - this is mainly done through a configuration file inside the module's jar file (if you are using NetBeans 5.0 or greater's module building support, you can usually avoid hand-editing this file). Most things a module does to influence the environment are link:DevFaqModulesDeclarativeVsProgrammatic.asciidoc[declarative] rather than programmatic - in other words, you put some text in an XML file, or an entry in a jar manifest, or a file in some specific place in the module jar, and your functionality will be discovered when the system starts up - as opposed to writing java code.
Two of the most common needs are opening custom link:DevFaqWindowsTopComponent.asciidoc[Swing components] in the UI, and link:DevFaqActionAddMenuBar.asciidoc[installing actions in the main menu ].
Other basic topics that are worth reading to get the lay of the land are:
* link:DevFaqLookup.asciidoc[Lookup]
* link:DevFaqModulesStartupActions.asciidoc[How to run some code on startup]
* link:DevFaqFileSystem.asciidoc[Overview of filesystems]
* link:DevFaqWindowsGeneral.asciidoc[The windowing system]
There are link:DevFaqTutorialsIndex.asciidoc[various tutorials], and the canonical reference to NetBeans APIs is the link:http://bits.netbeans.org/dev/javadoc/index.html[API javadoc].
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevFaqApisBasics[http://wiki.netbeans.org/DevFaqApisBasics] ,
that was last modified by NetBeans user Geertjan
on 2010-06-14T09:01:17Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.