-
Notifications
You must be signed in to change notification settings - Fork 1
DefFaqMapApisToTasks
Here is a list of common things people need to do, and a very short description of how you do them. From here, use the Javadoc and tutorials to get more information.
Use the Window System API. You will want to create a subclass of TopComponent, a JPanel-like class, and call its open()
method to show it.
Use the I/O API. Call IOProvider.getDefault().getInputOutput("Something")
. The object returned has getters for standard output, standard error and input streams which write to and read from a tab in the output window.
Use the Nodes API to create a hierarchy of Node objects, each representing one object in your data model. Then use the Explorer API to show the Nodes - it contains tree, list, table, combo box and other controls which can show a hierarchy of Nodes. Nodes are very easy to add popup menus to, decorate with icons and html-ized display names, etc. and are a lot less work than using Swing components directly. See also the Nodes API Tutorial.
Use the new File Type template. You will end up using the Data Systems API (DataObject, DataLoader, etc.) and Nodes API primarily, plus the Filesystems API for accessing and parsing the file. The Text API provides general support for creating editors for files.
No specific NetBeans APIs are needed - you can just create a subclass of Swing’s AbstractAction
, and register it in your modules layer.xml file. Or, use the new Action template in the IDE to generate a subclass of SystemAction
for you and all the registration code, and fill in the action-performing logic.
Use the Navigator API to create a navigator panel provider; you then somehow parse the file and can create any component you want to show in the Navigator, and populate it with whatever you want.
Use the Progress API - call ProgressHandleFactory
to create a ProgressHandle
for you. That is an object with methods for setting the progress, status text, number of steps, etc. and is fairly self-explanatory. Remember to make sure the code showing progress is not running in the AWT Event thread.
Use the UI Utilities API. Simply call StatusDisplayer.getDefault().setStatusText()
.
Define a folder in the System Filesystem in the XML layer file of your module. Other modules can register instances of whatever class you specify by declaring .instance
files in their own XML layer files. You can find them at runtime using Lookups.forPath("path/to/my/folder")
to get an instance of Lookup that you can query for these objects.
Use the Utilities API, specifically NbPreferences - which is just an implementation of the JDK’s Preferences API which stores things in the user’s settings directory rather than globally. It’s just like using standard JDK Preferences.
Use the Module System API. Implement a subclass of ModuleInstall and override restored()
, close()
, etc. Remember it is best to avoid running code on startup unless you really need to.
Use the Options API, implementing OptionsCategory to define the category in the dialog and OptionsPanelController to manage the UI component.
Use the Project UI API, specifically OpenProjects.
Use the Visual Library, which builds on top of Swing to make animated, graph-oriented UIs easy to build. More info, tutorials and webcasts can be found in the platform.netbeans.org/graph project.
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DefFaqMapApisToTasks , that was last modified by NetBeans user Skygo on 2013-12-13T23:52:13Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.