NetBeans Architecture Answers for JavaHelp Integration module
- Author: [email protected]
- Answers as of: May 13, 2025
- Answers for questions version: 1.12
- Latest available version of questions: 1.29
Interfaces table
Group of java interfaces
Interface Name | In/Out | Stability | Specified in What Document? |
---|---|---|---|
JavaHelpIntegrationAPI | Exported | Official | index.html |
ModulesAPI | Imported | Official | .../overview-summary.html The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required. |
UtilitiesAPI | Imported | Official | .../overview-summary.html The module is needed for compilation. The module is used during runtime. Specification version 9.3 is required. |
ServicesAPI | Imported | Official | .../org/openide/util/doc-files/api.html |
NodesAPI | Imported | Official | .../overview-summary.html The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required. |
WindowSystemAPI | Imported | Official | .../overview-summary.html The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required. |
ActionsAPI | Imported | Official | .../overview-summary.html |
Progress | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 1.40 is required. |
ProgressSwing | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 1.40 is required. |
SearchProvider | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 1.0 is required. |
org.openide.awt | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required. |
FilesystemsAPI | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 9.0 is required. |
LoadersAPI | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 7.61 is required. |
WeakListener.setAccessible | Imported | Under Development | The module is needed for compilation. The module is used during runtime. Specification version 9.3 is required. |
LookupAPI | Imported | Official | The module is needed for compilation. The module is used during runtime. Specification version 8.0 is required. |
ModalityExcludeAPI | Imported | Friend | offered by some JDKs and tracked as Java bug (5092094) allowing to exclude modal dialogs behaviour for certain windows - in this case the help window. |
Group of property interfaces
Interface Name | In/Out | Stability | Specified in What Document? |
---|---|---|---|
OpenIDE-mergeIntoMaster | Exported | Official |
The context and key OpenIDE/mergeIntoMaster can be set as an attribute on a help set
provided programmatically rather than with an XML file to
customize one attribute. Such programmatic provision is rare
but supported.
|
javahelp.ignore.modality | Exported | Friend | The help window through JDK 1.5.0 handles modal dialogs by reparenting the help component into a child dialog of any new modal dialog whenever it is shown, and reparenting it back into a frame whenever it is hidden. Under certain circumstances (showing two dialogs sequentially before the frame can be re-shown), it can produce a race condition in the underlying java.awt.Toolkit implementation. As a workaround, callers of DialogDisplayer.getDefault().notify(DialogDescriptor) may set the system property "javahelp.ignore.modality" to the String "true". This system property will be reset by notify(), and applied as a client property of the root pane of the dialog to be shown. JavaHelp will, in turn, ignore the appearance of any dialog whose root pane posesses the client property "javahelp.ignore.modality" with the String value "true". |
Group of dtd interfaces
Interface Name | In/Out | Stability | Specified in What Document? |
---|---|---|---|
ObjectTag | Exported | Friend | overview-summary.html |
General Information
-
Question (arch-what):
What is this project good for?
Answer:
The JavaHelp integration API wraps the standard JavaHelp extension
library. It also provides a small additional API for NetBeans modules to
supply help sets to the system, add GUI menu items, and request that
particular help topics be displayed.
JavaHelpIntegrationAPI
Question (arch-overall):
Describe the overall architecture.
WARNING: Question with id="arch-overall" has not been answered!
Question (arch-usecases):
Describe the main
use cases of the new API. Who will use it under
what circumstances? What kind of code would typically need to be written
to use the module?
WARNING: Question with id="arch-usecases" has not been answered!
Question (arch-time):
What are the time estimates of the work?
WARNING: Question with id="arch-time" has not been answered!
Question (arch-quality):
How will the quality
of your code be tested and
how are future regressions going to be prevented?
WARNING: Question with id="arch-quality" has not been answered!
Question (arch-where):
Where one can find sources for your module?
WARNING: Question with id="arch-where" has not been answered!
Project and platform dependencies
-
Question (dep-nb):
What other NetBeans projects and modules does this one depend on?
Answer:
- Progress - The module is needed for compilation. The module is used during runtime. Specification version 1.40 is required.
- ProgressSwing - The module is needed for compilation. The module is used during runtime. Specification version 1.40 is required.
- SearchProvider - The module is needed for compilation. The module is used during runtime. Specification version 1.0 is required.
- org.openide.awt - The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required.
- FilesystemsAPI - The module is needed for compilation. The module is used during runtime. Specification version 9.0 is required.
- LoadersAPI - The module is needed for compilation. The module is used during runtime. Specification version 7.61 is required.
- ModulesAPI - The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required.
- NodesAPI - The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required.
- UtilitiesAPI - The module is needed for compilation. The module is used during runtime. Specification version 9.3 is required.
- WeakListener.setAccessible - The module is needed for compilation. The module is used during runtime. Specification version 9.3 is required.
- LookupAPI - The module is needed for compilation. The module is used during runtime. Specification version 8.0 is required.
- WindowSystemAPI - The module is needed for compilation. The module is used during runtime. Specification version 6.2 is required.
The default answer to this question is:
These modules are required in project.xml:
Deployment
-
Question (deploy-jar):
Do you deploy just module JAR file(s) or other files as well?
Answer:
The JavaHelp extension library (jh.jar) is included, currently at version 1.1.3.
Note that some versions of Solaris ship with their own copy of this library in the location /usr/j2se/opt/javahelp/lib/jhall.jar. Since this JAR is included in the extensions path of the JRE on such machines, it would override the copy of jh.jar shipped with the NetBeans integration module. Normally this would be tolerable, but unfortunately the version shipped with Solaris is outdated and exhibits a number of serious bugs, especially in the handling of Japanese search text, which make the NetBeans help system unusable and which were fixed in subsequent official JavaHelp releases. (Note that search databases for JavaHelp help sets are often not cleanly usable in versions of JavaHelp other than the one in which they were built, since details of how HTML substring indices are calculated tend to be unstable between even minor releases.) To avoid such bugs, the NetBeans launcher checks for the existence of the abovementioned file, and if found, prepends the NetBeans jh.jar to the JVM's boot classpath. Other options were considered and rejected as unworkable.
Question (deploy-nbm): Can you deploy an NBM via the Update Center? Answer: Yes. Question (deploy-shared): Do you need to be installed in the shared location only, or in the user directory only, or can your module be installed anywhere? Answer: Either. Question (deploy-packages): Are packages of your module made inaccessible by not declaring them public? Answer: Yes. Question (deploy-dependencies): What do other modules need to do to declare a dependency on this one, in addition to or instead of the normal module dependency declaration (e.g. tokens to require)? WARNING: Question with id="deploy-dependencies" has not been answered!Compatibility with environment
-
Question (compat-i18n):
Is your module correctly internationalized?
Answer:
Yes.
Question (compat-standards):
Does the module implement or define any standards? Is the
implementation exact or does it deviate somehow?
Answer:
It only implements its own integration API. The JavaHelp reference
implementation is bundled and that implements the JavaHelp API.
Question (compat-version):
Can your module coexist with earlier and future
versions of itself? Can you correctly read all old settings? Will future
versions be able to read your current settings? Can you read
or politely ignore settings stored by a future version?
Answer:
N/A
Question (compat-deprecation):
How the introduction of your project influences functionality
provided by previous version of the product?
WARNING: Question with id="compat-deprecation" has not been answered!
Access to resources
-
Question (resources-file):
Does your module use
java.io.File
directly?
Answer:
It uses InstalledFileLocator
to implement the
nbdocs
URL protocol, permitting help sets or files to be
loaded from disk files in the NetBeans installation, rather than from
inside the module. This is necessary to make it easy for users to
customize CSS stylesheets, for example.
Question (resources-layer):
Does your module provide own layer? Does it create any files or
folders in it? What it is trying to communicate by that and with which
components?
Answer:
The layer registers the Help
singleton, declares some XML
DTDs and their processors, installs some menu items, etc.
Question (resources-read):
Does your module read any resources from layers? For what purpose?
Answer:
Not directly. It uses lookup to find help sets, while providing an XML
processor to make this easier. It provides another XML processor
permitting modules to add menu items, but does not directly interpret
these.
Question (resources-mask):
Does your module mask/hide/override any resources provided by other modules in
their layers?
Answer:
No. However the usersguide
module does mask the master help
link menu item created by this module, replacing it with a similar one
which jumps straight to the introductory page of the main NetBeans online
help.
Question (resources-preferences):
Does your module uses preferences via Preferences API? Does your module use NbPreferences or
or regular JDK Preferences ? Does it read, write or both ?
Does it share preferences with other modules ? If so, then why ?
WARNING: Question with id="resources-preferences" has not been answered!
Lookup of components
-
Question (lookup-lookup):
Does your module use
org.openide.util.Lookup
or any similar technology to find any components to communicate with? Which ones?
Answer:
It searches for instances of javax.help.HelpSet
in lookup,
according to the API specification.
Question (lookup-register):
Do you register anything into lookup for other code to find?
Answer:
A singleton instance of org.netbeans.api.javahelp.Help
is
registered into lookup, according to the API specification. Modules may
depend on its existence by requiring a token of the same name. An
instance of a handler for the nbdocs
URL protocol (covered
in the specification) is also registered.
Question (lookup-remove):
Do you remove entries of other modules from lookup?
Answer:
No.
Execution Environment
-
Question (exec-property):
Is execution of your code influenced by any environment or
Java system (
-
OpenIDE-mergeIntoMaster
-
The context and key
OpenIDE/mergeIntoMaster
can be set as an attribute on a help set provided programmatically rather than with an XML file to customize one attribute. Such programmatic provision is rare but supported. - javahelp.ignore.modality - The help window through JDK 1.5.0 handles modal dialogs by reparenting the help component into a child dialog of any new modal dialog whenever it is shown, and reparenting it back into a frame whenever it is hidden. Under certain circumstances (showing two dialogs sequentially before the frame can be re-shown), it can produce a race condition in the underlying java.awt.Toolkit implementation. As a workaround, callers of DialogDisplayer.getDefault().notify(DialogDescriptor) may set the system property "javahelp.ignore.modality" to the String "true". This system property will be reset by notify(), and applied as a client property of the root pane of the dialog to be shown. JavaHelp will, in turn, ignore the appearance of any dialog whose root pane posesses the client property "javahelp.ignore.modality" with the String value "true".
System.getProperty
) property?
On a similar note, is there something interesting that you
pass to java.util.logging.Logger
? Or do you observe
what others log?
Answer:
No.
Question (exec-component):
Is execution of your code influenced by any (string) property
of any of your components?
Answer:
instanceof
,
work with java.lang.Class
, etc.)?
Answer:
No.
Question (exec-threading):
What threading models, if any, does your module adhere to? How the
project behaves with respect to threading?
WARNING: Question with id="exec-threading" has not been answered!
Question (security-policy):
Does your functionality require modifications to the standard policy file?
WARNING: Question with id="security-policy" has not been answered!
Question (security-grant):
Does your code grant additional rights to some other code?
WARNING: Question with id="security-grant" has not been answered!
Format of files and protocols
-
Question (format-types):
Which protocols and file formats (if any) does your module read or write on disk,
or transmit or receive over the network? Do you generate an ant build script?
Can it be edited and modified?
Answer:
- The bundled JavaHelp code reads standard help sets.
- There is a published XML DTD for declaring the existence of a help set.
- There is a published XML DTD for creating a menu item pointing to a help topic.
- ObjectTag - This tag is used in HTML content to create hyperlink like label in JHContentViewer. It invokes IDE default HTML Browser to correctly display external links.
java.awt.datatransfer.Transferable
?
Answer:
N/A
Performance and Scalability
-
Question (perf-startup):
Does your module run any code on startup?
Answer:
Yes, it registers a global AWT window listener. This appears to be the
only way to reliably tell whether a modal dialog is showing at a given
time (and to receive notification when one is shown). There is a rather
complex set of hacks to convert the help viewer into a nonmodal dialog
and reparent it to an active modal dialog; otherwise it would be
impossible to access help while a modal dialog was showing. There is an
open request for AWT to support multiple application contexts, which
would permit the help viewer to live in an independent context and not be
blocked by modal dialogs used in NetBeans, but until this is fixed there
is no known good solution to the modality problem.
Question (perf-exit):
Does your module run any code on exit?
Answer:
No.
Question (perf-scale):
Which external criteria influence the performance of your
program (size of file in editor, number of files in menu,
in source directory, etc.) and how well your code scales?
Answer:
Size of help set XML files (the map file especially) probably impacts
parsing speed and memory consumption. Number of distinct help sets will
probably impact performance as well. Exact numbers unknown, but JavaHelp
appears to be pretty slow to parse and merge help sets.
Question (perf-limit):
Are there any hard-coded or practical limits in the number or size of
elements your code can handle?
Answer:
When displaying help, all help sets need to be parsed by JavaHelp to
determine the ID maps. For a large number of help sets, this might
consume too much memory and CPU to be practical. Also when displaying
"merged" help (the normal case), all help sets need to be merged
together, which can also be time-consuming as their number grows.
Question (perf-mem):
How much memory does your component consume? Estimate
with a relation to the number of windows, etc.
Answer:
Unknown. Help sets which are not in active use are supposed to be held
softly so they could be collected.
Question (perf-wakeup):
Does any piece of your code wake up periodically and do something
even when the system is otherwise idle (no user interaction)?
Answer:
No.
Question (perf-progress):
Does your module execute any long-running tasks?
Answer:
Loading and merging help sets is done asynchronously since it can be
slow.
Question (perf-huge_dialogs):
Does your module contain any dialogs or wizards with a large number of
GUI controls such as combo boxes, lists, trees, or text areas?
Answer:
The JavaHelp window is fairly complex, but the module only provides the
frame that contains it.
Question (perf-menus):
Does your module use dynamically updated context menus, or
context-sensitive actions with complicated and slow enablement logic?
Answer:
Menu items representing links to help topics are dynamically enabled or
disabled. They are always enabled in case help sets have not yet been
parsed, to avoid forcing a parse just to display the menu item; if
selected at this time when there is no actual corresponding ID, they will
do nothing. After help sets have been parsed, menu items referring to
help topics which are actually available (the normal case) are enabled.
In case a help topic is missing for some reason, the menu item is
disabled.
Question (perf-spi):
How the performance of the plugged in code will be enforced?
WARNING: Question with id="perf-spi" has not been answered!