Skip to main content

[JAVAHELP] Assigning a help ID to a compound component

3 replies [Last post]
Anonymous

Hi all,

I am having a problem when attempting to assign a help ID to a compound
component, such as a JComboBox and a JSpinner. The way that I currently
have my code written is such that if the component has focus AND has a
help ID assigned, it will display the help content through the secondary
viewer. Otherwise, it will display help in the main viewer. However, the
compound components will display help only in the help viewer regardless
that a help ID is assigned to it.

The only way that I have figured this to work is to assign the help ID
specifically to the subcomponent. Does anyone know if this is the only
way? I am trying to keep the method of assigning help ID's consistent by
just passing the component itself and not the subcomponent. Thanks in
advance. Here is my workaround for assigning an ID to the subcomponent of
a spinner, I haven't found a way for a combo box yet:

HelpManager.getInstance().setHelpIdString(
((JSpinner.DefaultEditor)
frequencyAttenuationSpinner.getEditor()).getTextField(),
"frequencyAttenuationSpinner");

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
SUBSCRIBE JAVAHELP-INTEREST Anonymous

Thanks Binky. Is this a known problem and if so, will it be addressed in
the next release version? Also, has there been any news on the release
date for the next version of JavaHelp?

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Roger Brinkley

Anonymous wrote:

> Thanks Binky. Is this a known problem and if so, will it be addressed in
> the next release version? Also, has there been any news on the release
> date for the next version of JavaHelp?

You can already do it in the current release of JavaHelp.

Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.

Roger Brinkley

Dennis Seran wrote:

> Hi all,
>
> I am having a problem when attempting to assign a help ID to a compound
> component, such as a JComboBox and a JSpinner. The way that I currently
> have my code written is such that if the component has focus AND has a
> help ID assigned, it will display the help content through the secondary
> viewer. Otherwise, it will display help in the main viewer. However, the
> compound components will display help only in the help viewer regardless
> that a help ID is assigned to it.
>
> The only way that I have figured this to work is to assign the help ID
> specifically to the subcomponent. Does anyone know if this is the only
> way? I am trying to keep the method of assigning help ID's consistent by
> just passing the component itself and not the subcomponent. Thanks in
> advance. Here is my workaround for assigning an ID to the subcomponent of
> a spinner, I haven't found a way for a combo box yet:
>
> HelpManager.getInstance().setHelpIdString(
> ((JSpinner.DefaultEditor)
> frequencyAttenuationSpinner.getEditor()).getTextField(),
> "frequencyAttenuationSpinner");
>

Sounds like the common problem with compound components. Look at
creating a CSHManager for the JComboBox or JSpinner. More information is
in the programming section of the JavaHelp User's Guide.

Binky
Binky

********************************************************************************

You may leave the list at any time by sending message with no subject and
"SIGNOFF JAVAHELP-INTEREST" in the body to LISTSERV@JAVA.SUN.COM. Archives
are available at http://archives.java.sun.com/archives/javahelp-interest.html.
Submit bug reports at http://java.sun.com/cgi-bin/bugreport.cgi.