NetBeansDeveloperFAQ

(Difference between revisions)
(How to force check for updates at every startup?)
(Deploying Changes through AutoUpdate and using Autoupdate API: How to change the update center URL via code)
 
(21 intermediate revisions not shown)
Line 123: Line 123:
* [[DevFaqActionAddMenuBar| How do I add an action to the main menu?]]
* [[DevFaqActionAddMenuBar| How do I add an action to the main menu?]]
* [[DevFaqActionAddToolBar| How do I add an action to a toolbar in the main window?]]
* [[DevFaqActionAddToolBar| How do I add an action to a toolbar in the main window?]]
 +
* [[DevFaqToggleActionAddToEditorToolbar| How do I add a toggle-able action to the toolbar/main menu?]]
* [[DevFaqActionAddToEditorToolbar| How do I add an action to the toolbar of the editor?]]
* [[DevFaqActionAddToEditorToolbar| How do I add an action to the toolbar of the editor?]]
* [[DevFaqActionContextSensitive| How do I make an action that is automatically enabled/disabled depending on what's selected?]]
* [[DevFaqActionContextSensitive| How do I make an action that is automatically enabled/disabled depending on what's selected?]]
-
* [[DevFaqCheckableActionPreferenceOption| How do I make a checkable action that represents a preference option?]]
+
* [[DevFaqCheckableActionPreferenceOption| How do I make a checkable/toggle-able action that represents a preference option?]]
* [[DevFaqActionsFolder| What is the Actions folder in the system filesystem, and why should I use it?]]
* [[DevFaqActionsFolder| What is the Actions folder in the system filesystem, and why should I use it?]]
 +
* [[DevFaqActionsAddAtRuntime| How do I add an action (incl. shortcut) at runtime?]]
* [[DevFaqActionAddFileMime| How do I add an action to all files of a given mime-type?]]
* [[DevFaqActionAddFileMime| How do I add an action to all files of a given mime-type?]]
* [[DevFaqActionAddEditorPopup| How do I add an action to the context menu of a specific editor?]]
* [[DevFaqActionAddEditorPopup| How do I add an action to the context menu of a specific editor?]]
Line 162: Line 164:
* [[DevFaqInvokeActionProgrammatically|How do I invoke an action programmatically?]]
* [[DevFaqInvokeActionProgrammatically|How do I invoke an action programmatically?]]
* [[DevFaqHowOrganizeOrReuseExistingActionsWithAnnotations|How can I reuse and/or organise actions only by using annotations (@ActionReferences)?]]
* [[DevFaqHowOrganizeOrReuseExistingActionsWithAnnotations|How can I reuse and/or organise actions only by using annotations (@ActionReferences)?]]
-
 
+
* [[DevFaqHowToFixPopuppresenterreturningnull|How can I fix "WARNING [org.openide.util.Utilities]: findContextMenuImpl, getPopupPresenter returning null for" when using a PopupPresenter ?]]
 +
* [[DevFaqHowToDefineTheKeyMapCategoryForAnAction|How do I define and localise the keymap category of an action?]]
<!-- * [[DevFaqHowCreateAnActionObject| How can I to create an Action object and attach this action to one or more components on frame without manually editing Generated Code?]] -->
<!-- * [[DevFaqHowCreateAnActionObject| How can I to create an Action object and attach this action to one or more components on frame without manually editing Generated Code?]] -->
 +
* [[DevFaqAddMacroableAction|How do I create an action which can be invoked by a macro?]]
===Key Bindings===
===Key Bindings===
Line 174: Line 178:
* [[DevFaqAddDefaultActionShortcuts|How do I add default shortcuts for SystemActions (like cut, paste, etc)?]]
* [[DevFaqAddDefaultActionShortcuts|How do I add default shortcuts for SystemActions (like cut, paste, etc)?]]
* [[DevFaqGetShortCutForAction|How to get the shortcut/shortkey of an action at runtime?]]
* [[DevFaqGetShortCutForAction|How to get the shortcut/shortkey of an action at runtime?]]
 +
* [[DevFaqAddShortCutForAction|How to set the shortcut of an action outside of your own module?]]
===Lookup===
===Lookup===
Line 228: Line 233:
===Editor and Edited Files===
===Editor and Edited Files===
 +
* [[DevFaqGetOpenEditorWindows| How can I get a list of open editors/documents?]]
 +
* [[DevFaqEditorGetCurrentDocument| How can I get the currently open document in the selected editor?]]
 +
* [[DevFaqListenEditorChanges| How can I track what file the user is currently editing?]]
 +
* [[DevFaqFindCaretPositionInEditor| How can I get the position of the caret/line in the selected editor?]]
* [[DevFaqOpenReadOnly| How can I open a file in the editor in read-only mode?]]
* [[DevFaqOpenReadOnly| How can I open a file in the editor in read-only mode?]]
 +
* [[DevFaqOpenFileAtLine| How can I open a file in the editor at a particular line number and column?]]
 +
* [[DevFaqEditorHowToGetMimeTypeFromDocumentOrJTextComponent| How to get mime type from Document or JTextComponent?]]
* [[DevFaqModifyOpenFile| Is it safe to programmatically modify a file which is open in the editor?]]
* [[DevFaqModifyOpenFile| Is it safe to programmatically modify a file which is open in the editor?]]
-
* [[DevFaqGetOpenEditorWindows| How can I get a list of open editor windows?]]
 
-
* [[DevFaqFindCaretPositionInEditor| How can I get the position of the caret/line in the currently selected editor window?]]
 
-
* [[DevFaqOpenFileAtLine| How can I open a particular file at a particular line number and column?]]
 
-
* [[DevFaqFileEditorContextMenuAddition| Can I add a menu item to the context menu of the Java source editor?]]
 
-
* [[DevFaqEditorGetCurrentDocument| How can I find the currently open document in the selected editor?]]
 
-
* [[DevFaqListenEditorChanges| How can I track what file the user is currently editing?]]
 
* [[DevFaqMultipleProgrammaticEdits| I want to make some programmatic changes to the edited file.  How can I do it so one Undo undoes it all?]]
* [[DevFaqMultipleProgrammaticEdits| I want to make some programmatic changes to the edited file.  How can I do it so one Undo undoes it all?]]
* [[DevFaqSyntaxColoring| Can I add syntax coloring for my own data object/MIME type?]]
* [[DevFaqSyntaxColoring| Can I add syntax coloring for my own data object/MIME type?]]
 +
* [[DevFaqEditorCodeCompletionAnyJEditorPane| How to add code completion to any JEditorPane]]
* [[DevFaqEditorWhatIsMimePath| What is MimePath?]]
* [[DevFaqEditorWhatIsMimePath| What is MimePath?]]
* [[DevFaqEditorWhatIsMimeLookup| What is MimeLookup?]]
* [[DevFaqEditorWhatIsMimeLookup| What is MimeLookup?]]
* [[DevFaqEditorHowIsMimeLookupComposed| How is MimeLookup composed?]]
* [[DevFaqEditorHowIsMimeLookupComposed| How is MimeLookup composed?]]
* [[DevFaqEditorJEPForMimeType| How can I create JEditorPane for a specific document type?]]
* [[DevFaqEditorJEPForMimeType| How can I create JEditorPane for a specific document type?]]
-
* [[DevFaqEditorHowToGetMimeTypeFromDocumentOrJTextComponent| How to get mime type from Document or JTextComponent?]]
 
-
* [[DevFaqEditorCodeCompletionAnyJEditorPane| How to add code completion to any JEditorPane]]
 
* [[DevFaqI18nFileEncodingQueryObject| Project Encoding vs. File Encoding - What are the precedence rules used in NetBeans 6.0?]]
* [[DevFaqI18nFileEncodingQueryObject| Project Encoding vs. File Encoding - What are the precedence rules used in NetBeans 6.0?]]
* [https://blogs.oracle.com/geertjan/entry/creating_error_annotations_in_netbeans2 I want to add annotations to my editor, for errors, or other reasons. How?]
* [https://blogs.oracle.com/geertjan/entry/creating_error_annotations_in_netbeans2 I want to add annotations to my editor, for errors, or other reasons. How?]
 +
* [[DevFaqFileEditorContextMenuAddition| Can I add a menu item to the context menu of the Java source editor?]]
* [[DevFaqEditorHowToAddDiffView| How to use the diff view in my own application/plugin?]]
* [[DevFaqEditorHowToAddDiffView| How to use the diff view in my own application/plugin?]]
* [[DevFaqEditorHowToReuseEditorHighlighting| How to reuse XML syntax highlighting in your own editor]]
* [[DevFaqEditorHowToReuseEditorHighlighting| How to reuse XML syntax highlighting in your own editor]]
 +
* [[DevFaqEditorHowToAddCodeTemplates| How to add code templates?]]
=== File Management (within the IDE/Application)===
=== File Management (within the IDE/Application)===
Line 303: Line 309:
* [http://rubenlaguna.com/wp/2010/01/18/cancellable-tasks-and-progress-indicators-netbeans-platform/ Cancellable Tasks and Progress Indicators]
* [http://rubenlaguna.com/wp/2010/01/18/cancellable-tasks-and-progress-indicators-netbeans-platform/ Cancellable Tasks and Progress Indicators]
* [[DevFaqTaskLongRunningAsyncTask| How to execute a long running task from an action without blocking the GUI?]]
* [[DevFaqTaskLongRunningAsyncTask| How to execute a long running task from an action without blocking the GUI?]]
 +
* [[DevFaqExternalExecution| How to run/execute an external program?]]
===Command Line Parsing===
===Command Line Parsing===
Line 322: Line 329:
===Settings===
===Settings===
-
 
* [[DevFaqSetPrefs| How do I let the user set preferences/options/customization/configuration for my module/application?]]
* [[DevFaqSetPrefs| How do I let the user set preferences/options/customization/configuration for my module/application?]]
* [[DevFaqExtendOptionsWindow| Can I add new panels to the Options window?]]
* [[DevFaqExtendOptionsWindow| Can I add new panels to the Options window?]]
* [[DevFaqExportImport| How to register options for export/import to module's layer?]]
* [[DevFaqExportImport| How to register options for export/import to module's layer?]]
* [[DevFaqJavaStartParms| How do I change the application's Java start parameters?]]
* [[DevFaqJavaStartParms| How do I change the application's Java start parameters?]]
-
* [[DevFaqExtendOptionsSearch| How can configure my options panel to be found by global quicksearch or options search?]]
+
* [[DevFaqExtendOptionsSearch| How can I configure my options panel to be found by global quicksearch or options search?]]
 +
* [[DevFaqOpenOptionsAtCategory| How do you open the option dialog with a preselected category?]]
 +
* [[DevFaqHowToChangeSettingsFromAnExternalModules| How do you change the configuration of other modules?]]
===Window System===
===Window System===
Line 369: Line 377:
* [https://blogs.oracle.com/geertjan/entry/visual_editor_part_6 How do I get started with the XML Multiview API? (Part 6)]
* [https://blogs.oracle.com/geertjan/entry/visual_editor_part_6 How do I get started with the XML Multiview API? (Part 6)]
* [https://blogs.oracle.com/geertjan/entry/visual_editor_part_7 How do I get started with the XML Multiview API? (Part 7)]
* [https://blogs.oracle.com/geertjan/entry/visual_editor_part_7 How do I get started with the XML Multiview API? (Part 7)]
 +
* [[DevFaqMultiViewChangeTabInCode| How to change selected tab of Multiview?]]
===Project Handling===
===Project Handling===
Line 416: Line 425:
* [https://blogs.oracle.com/geertjan/entry/propertyeditorsupport_paintvalue How do I color the cells in a property sheet?]
* [https://blogs.oracle.com/geertjan/entry/propertyeditorsupport_paintvalue How do I color the cells in a property sheet?]
* [https://blogs.oracle.com/geertjan/entry/propertyeditorsupport_paintvalue How do I display an icon in my property sheet?]
* [https://blogs.oracle.com/geertjan/entry/propertyeditorsupport_paintvalue How do I display an icon in my property sheet?]
 +
* [[DevFaqPropertySheetHideDescription| How do I hide the description area in property window?]]
 +
* [[DevFaqPropertySheetReadonlyProperty| How do I add a readonly property?]]
===Output Window===
===Output Window===
Line 458: Line 469:
===JavaHelp===
===JavaHelp===
 +
* [[DevFaqHelpGuidelines| JavaHelp integration guide]]
* [[DevFaqIdeWelcome| How do I fix problems about 'ide.welcome'?]]
* [[DevFaqIdeWelcome| How do I fix problems about 'ide.welcome'?]]
* [https://blogs.oracle.com/geertjan/entry/branding_the_default_help_topic How do I change the default help topic?]
* [https://blogs.oracle.com/geertjan/entry/branding_the_default_help_topic How do I change the default help topic?]
Line 469: Line 481:
* [[DevFaqChangeLookAndFeel|How can I set the Swing look and feel on startup?]]
* [[DevFaqChangeLookAndFeel|How can I set the Swing look and feel on startup?]]
* [[DevFaqCustomFontSize| I have a custom component.  How can I make it respond to --fontsize like the rest of NetBeans?]]
* [[DevFaqCustomFontSize| I have a custom component.  How can I make it respond to --fontsize like the rest of NetBeans?]]
 +
* [[DevFaqImagesForDarkLaf|How to provide non-inverted images for dark LookAndFeels like DarkMetal/Darcula?]]
===Deploying Changes through AutoUpdate and using Autoupdate API===
===Deploying Changes through AutoUpdate and using Autoupdate API===
Line 481: Line 494:
* [[DevFaqNBMPack200| How to deal with pack200 compression in NBM?]] (''since NB6.9'')
* [[DevFaqNBMPack200| How to deal with pack200 compression in NBM?]] (''since NB6.9'')
* [[DevFaqAutoUpdateCheckEveryStartup| How to force to check for updates at every startup?]]
* [[DevFaqAutoUpdateCheckEveryStartup| How to force to check for updates at every startup?]]
 +
* [[DevFaqHowToChangeUpdateCenterURL|How to change the update center URL via code?]]
===Deployment using installers / NBI===
===Deployment using installers / NBI===

Current revision as of 14:18, 18 September 2016

This is the developer-oriented FAQ for NetBeans IDE 4.x, 5.x, 6.x, 7.x and 8.x. Developer in this context means "person writing NetBeans extension modules (plug-ins), or applications based on the NetBeans Platform". Don't see your developer-oriented question here? Ask on dev@platform.netbeans.org (subscribe to post). Not writing modules? See the list of other FAQs.

Want the whole FAQ in one big HTML file? Download it here for offline reading (rebuilt daily).

Here's How To Add FAQ Entries. One Big Important Thing about adding developer FAQ entries: If they don't start with "DevFaq" they are not going to get indexed properly. Please add items, but please follow this simple guideline.

Contents



Getting Started

Tutorials and important starting points

Getting support, where to find examples

Application Lifecycle and Hooks

Development issues, module basics and classpath issues, and information about RCP/Platform application configuration

Mavenized Builds

Configuration: How Modules Install Things

When There Are Multiple Ways To Do Something...

Actions: How to add things to Files, Folders, Menus, Toolbars and more

Key Bindings

Lookup

Files and Data Objects

Converting between common data types and finding things

Editor and Edited Files

File Management (within the IDE/Application)

Module System

Nodes and Explorer

Tasks and Progressbar

Command Line Parsing

Threading

Creating a Custom Programming Language

Settings

Window System

Dialogs API

XML Multiview API

Project Handling

Project Types

Also see BuildSystemDesign and ProjectGroups.

Saving

Versioning

Printing

HTML Browser

Wizards and Templates

Properties and PropertySheet

Output Window

Using Enterprise Resources from NetBeans module

Running and Writing tests

Branding your application

Authentication and Authorization in Platform Apps

Logging and Error Handling


JavaHelp

Look and Design

Deploying Changes through AutoUpdate and using Autoupdate API

Deployment using installers / NBI

Programmatic access to Java Sources

The following applies only to NetBeans 6.0 and later.

When things go wrong: Troubleshooting


Licensing Issues

Using Sounds

Contributor Agreement


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo