Skip to main content

how to get *one* help window only

5 replies [Last post]
sawie
Offline
Joined: 2006-02-17

Hi,

I just started integrating JavaHelp into my application and I really like it. Even more after I found out how to change the icon in the window title bar :-) ...

I activated global help (F1 key) and context-sensitive help.
But now I have the following problem:
Each time I press F1 or klick on an item (with context-sensitive help selected) a new help window opens.
I.e. 3x F1 -> 3 help windows open
How can I manage to open only one help window and redirect each help request to this one?

Thanks for help!

Steffi

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Roger Brinkley

> I just started integrating JavaHelp into my application and I really
> like it. Even more after I found out how to change the icon in the
> window title bar :-) ...
>
> I activated global help (F1 key) and context-sensitive help. But now
> I have the following problem: Each time I press F1 or klick on an
> item (with context-sensitive help selected) a new help window opens.
> I.e. 3x F1 -> 3 help windows open How can I manage to open only one
> help window and redirect each help request to this one?

Probably depends on which CSH code your using. The idedemo works
correctly and it uses the V1 code that doesn't set presentation. What
code are you using to activate the help?

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.

sawie
Offline
Joined: 2006-02-17

> Probably depends on which CSH code your using. The
> idedemo works
> correctly and it uses the V1 code that doesn't set
> presentation. What
> code are you using to activate the help?
>
> Binky

ok, my code was:
helpBroker = helpSet.createHelpBroker("main");
...
ActionListener helpFromSource = new CSH.DisplayHelpFromSource(this.helpSet, "javax.help.MainWindow", "main");
ActionListener helpAfterTracking= new CSH.DisplayHelpAfterTracking(this.helpSet, "javax.help.MainWindow", "main");
...
helpBroker.enableHelpKey(rootPane, "index", this.helpSet, "javax.help.MainWindow", "main");

This opened a new window every time.

I changed it to:
helpBroker = helpSet.createHelpBroker("main");
...
ActionListener helpFromSource = new CSH.DisplayHelpFromSource(helpBroker);
ActionListener helpAfterTracking = new CSH.DisplayHelpAfterTracking(helpBroker);
...

This opens one window for the context-sensitive (mouse-klick) help, but also a new window for *every* F1 klick. To avoid this, I had to change the "helpBroker.enableHelpKey" line to

helpBroker.enableHelpKey(rootPane, "index", this.helpSet, "javax.help.SecondaryWindow", "main");

Now I get maximum two help windows: one for all F1 klicks, and one for all context-sensitive klicks.

This is the same behaviour as in the idedemo, I think.
Thanks for your hint to this!

Any chance to get only one window for all?

And what I just noticed: the javax.help.MainWindow displays the title which is defined in the presentation, but the javax.help.SecondaryWindow displays the title which is defined as in the html-file.</p> <p>Steffi</p> </div> </div> </div> <div class="forum-post-footer clear-block"> <div class="forum-post-links"> <ul class="links"><li class="comment_forbidden"><span><a href="/user/login?destination=comment%2Freply%2F648284%23comment-form">Login</a> or <a href="/user/register?destination=comment%2Freply%2F648284%23comment-form">register</a> to post comments</span></li> </ul> </div> </div> </div> <div class="indented"><a id="comment-612476"></a> <div id="comment-612476" class="forum-post commentodd clear-block"> <div class="post-info clear-block"> <div class="posted-on"> <div class="post-title"> Re: [JAVAHELP] how to get *one* help window only </div> February 26, 2004 - 10:00 </div> <span class="post-num"><a href="/node/648284#comment-612476" class="active">#3</a> </span> </div> <div class="forum-post-wrapper"> <div class="forum-post-panel-sub"> <div class="author-pane"> <div class="author-pane-inner"> <div class="author-pane-section author-pane-general"> <div class="author-pane-line author-name"> Roger Brinkley </div> </div> <div class="author-pane-section author-pane-contact"> </div> <div class="author-pane-section author-pane-admin"> </div> </div> </div> </div> <div class="forum-post-panel-main clear-block"> <div class="content"> <p>> ok, my code was:<br /> > helpBroker = helpSet.createHelpBroker("main");</p> <p>Key point!!! This is the only call that you ever need to make to set the<br /> presentation style of single main window help displayed for an<br /> application. Any other calls to CSH or helpBroker.enable* methods that<br /> set a presentationType and presentationName will create a new<br /> presentation unless otherwise controlled by the presentationType. Do<br /> this and then make the V1.0 calls for everything else if you want one<br /> MainWindow to appear.</p> <p>> ...<br /> > ActionListener helpFromSource = new CSH.DisplayHelpFromSource(this.helpSet, "javax.help.MainWindow", "main");<br /> > ActionListener helpAfterTracking= new CSH.DisplayHelpAfterTracking(this.helpSet, "javax.help.MainWindow", "main");<br /> > ...<br /> > helpBroker.enableHelpKey(rootPane, "index", this.helpSet, "javax.help.MainWindow", "main");<br /> ><br /> > This opened a new window every time.</p> <p>As I would expect it to. Each time you specify a presentationType and<br /> presentationName it will open a new presentation unless there is some<br /> type of matching rules that would suggest it use a current presentation.</p> <p>You could argue that MainWindow should be more restrictive and only open<br /> one MainWindow for an application. There are arguments to support<br /> multiple mainWindows as well that I won't go into at this time but are<br /> the main reason for less restrictive approach.</p> <p>><br /> > I changed it to:<br /> > helpBroker = helpSet.createHelpBroker("main");<br /> > ...<br /> > ActionListener helpFromSource = new CSH.DisplayHelpFromSource(helpBroker);<br /> > ActionListener helpAfterTracking = new CSH.DisplayHelpAfterTracking(helpBroker);<br /> > ...</p> <p>This is correct for opening only one window</p> <p>> This opens one window for the context-sensitive (mouse-klick) help,<br /> > but also a new window for *every* F1 klick.</p> <p>Yes, because you didn't change the enableHelpKey call. It's still<br /> opening a new MainWindow presentation every time because that's what you<br /> told it to do. Try the following line instead:</p> <p>helpBroker.enableHelpKey(rootPane, "index", this.helpSet);</p> <p>> To avoid this, I had to<br /> > change the "helpBroker.enableHelpKey" line to<br /> ><br /> > helpBroker.enableHelpKey(rootPane, "index", this.helpSet, "javax.help.SecondaryWindow", "main");<br /> ><br /> > Now I get maximum two help windows: one for all F1 klicks, and one for all context-sensitive klicks.</p> <p>Yes, because your using a named SecondaryWindow. If the window already<br /> exists it will be reused.</p> <p>> This is the same behaviour as in the idedemo, I think.</p> <p>Because the code does exactly the same think. The F1 keys come up in<br /> SecondaryWindow.</p> <p>> Thanks for your hint to this!<br /> ><br /> > Any chance to get only one window for all?</p> <p>Make the change to the enableHelpKey and it will work.</p> <p>> And what I just noticed: the javax.help.MainWindow displays the title<br /> > which is defined in the presentation, but the<br /> > javax.help.SecondaryWindow displays the title which is defined as<br /> > <title> in the html-file.</p> <p>Attribute of the SecondaryWindow.</p> <p>binky</p> <p>********************************************************************************</p> <p>You may leave the list at any time by sending message with no subject and<br /> "SIGNOFF JAVAHELP-INTEREST" in the body to <a href="mailto:LISTSERV@JAVA.SUN.COM">LISTSERV@JAVA.SUN.COM</a>. Archives<br /> are available at <a href="http://archives.java.sun.com/archives/javahelp-interest.html" title="http://archives.java.sun.com/archives/javahelp-interest.html">http://archives.java.sun.com/archives/javahelp-interest.html</a>.<br /> Submit bug reports at <a href="http://java.sun.com/cgi-bin/bugreport.cgi" title="http://java.sun.com/cgi-bin/bugreport.cgi">http://java.sun.com/cgi-bin/bugreport.cgi</a>.</p> </div> </div> </div> <div class="forum-post-footer clear-block"> <div class="forum-post-links"> <ul class="links"><li class="comment_forbidden"><span><a href="/user/login?destination=comment%2Freply%2F648284%23comment-form">Login</a> or <a href="/user/register?destination=comment%2Freply%2F648284%23comment-form">register</a> to post comments</span></li> </ul> </div> </div> </div> <div class="indented"><a id="comment-612477"></a> <div id="comment-612477" class="forum-post commenteven clear-block"> <div class="post-info clear-block"> <div class="posted-on"> <div class="post-title"> Re: [JAVAHELP] how to get *one* help window only </div> February 27, 2004 - 01:59 </div> <span class="post-num"><a href="/node/648284#comment-612477" class="active">#4</a> </span> </div> <div class="forum-post-wrapper"> <div class="forum-post-panel-sub"> <div class="author-pane"> <div class="author-pane-inner"> <div class="author-pane-section author-pane-general"> <div class="author-pane-line author-name"> sawie </div> <div class="author-pane-line author-offline"> Offline </div> <div class="author-pane-line author-joined"> <span class="author-pane-label">Joined:</span> 2006-02-17 </div> </div> <div class="author-pane-section author-pane-contact"> </div> <div class="author-pane-section author-pane-admin"> </div> </div> </div> </div> <div class="forum-post-panel-main clear-block"> <div class="content"> <p>> Yes, because you didn't change the enableHelpKey<br /> > call. It's still<br /> > opening a new MainWindow presentation every time<br /> > because that's what you<br /> > told it to do. Try the following line instead:<br /> ><br /> > helpBroker.enableHelpKey(rootPane, "index",<br /> > this.helpSet);</p> <p>That's it!<br /> Now it works!<br /> Thanks for your help and your detailed explanations!</p> <p>> > And what I just noticed: the javax.help.MainWindow<br /> > displays the title<br /> > > which is defined in the presentation, but the<br /> > > javax.help.SecondaryWindow displays the title which<br /> > is defined as<br /> > > <title> in the html-file.<br /> ><br /> > Attribute of the SecondaryWindow.</p> <p>Hmm, in the documentation (chapter about the Helpset File) I read the following:<br /> "Helpset title:<br /> The <title> defined in the helpset (.hs) file. This title appears at the top of the main window and any secondary windows defined in your helpset file."</p> <p>Steffi</p> </div> </div> </div> <div class="forum-post-footer clear-block"> <div class="forum-post-links"> <ul class="links"><li class="comment_forbidden"><span><a href="/user/login?destination=comment%2Freply%2F648284%23comment-form">Login</a> or <a href="/user/register?destination=comment%2Freply%2F648284%23comment-form">register</a> to post comments</span></li> </ul> </div> </div> </div> <div class="indented"><a id="comment-612478"></a> <div id="comment-612478" class="forum-post commentodd clear-block"> <div class="post-info clear-block"> <div class="posted-on"> <div class="post-title"> Re: [JAVAHELP] how to get *one* help window only </div> February 27, 2004 - 09:45 </div> <span class="post-num"><a href="/node/648284#comment-612478" class="active">#5</a> </span> </div> <div class="forum-post-wrapper"> <div class="forum-post-panel-sub"> <div class="author-pane"> <div class="author-pane-inner"> <div class="author-pane-section author-pane-general"> <div class="author-pane-line author-name"> Roger Brinkley </div> </div> <div class="author-pane-section author-pane-contact"> </div> <div class="author-pane-section author-pane-admin"> </div> </div> </div> </div> <div class="forum-post-panel-main clear-block"> <div class="content"> <p>> That's it!<br /> > Now it works!<br /> > Thanks for your help and your detailed explanations!</p> <p>This was a thought provoking problem. I had to go research the APIs,<br /> play with the demos, and rethink the design decisions. I can see why you<br /> made the programming decisions you did and what you thought the intended<br /> result would be. I'm still trying to decide if your programming decision<br /> was the result of a design flaw, or just the unintended result of an<br /> otherwise good design.</p> <p>>>>And what I just noticed: the javax.help.MainWindow<br /> >><br /> >>displays the title<br /> >><br /> >>>which is defined in the presentation, but the<br /> >>>javax.help.SecondaryWindow displays the title which<br /> >><br /> >>is defined as<br /> >><br /> >>><title> in the html-file.<br /> >><br /> >>Attribute of the SecondaryWindow.<br /> ><br /> ><br /> > Hmm, in the documentation (chapter about the Helpset File) I read the following:<br /> > "Helpset title:<br /> > The <title> defined in the helpset (.hs) file. This title appears at the top of the main window and any secondary windows defined in your helpset file."<br /> ></p> <p>Mom, that is NOT my hand in the cookie jar!!!</p> <p>File a bug report and I'll look at it.</p> <p>Binky</p> <p>********************************************************************************</p> <p>You may leave the list at any time by sending message with no subject and<br /> "SIGNOFF JAVAHELP-INTEREST" in the body to <a href="mailto:LISTSERV@JAVA.SUN.COM">LISTSERV@JAVA.SUN.COM</a>. Archives<br /> are available at <a href="http://archives.java.sun.com/archives/javahelp-interest.html" title="http://archives.java.sun.com/archives/javahelp-interest.html">http://archives.java.sun.com/archives/javahelp-interest.html</a>.<br /> Submit bug reports at <a href="http://java.sun.com/cgi-bin/bugreport.cgi" title="http://java.sun.com/cgi-bin/bugreport.cgi">http://java.sun.com/cgi-bin/bugreport.cgi</a>.</p> </div> </div> </div> <div class="forum-post-footer clear-block"> <div class="forum-post-links"> <ul class="links"><li class="comment_forbidden"><span><a href="/user/login?destination=comment%2Freply%2F648284%23comment-form">Login</a> or <a href="/user/register?destination=comment%2Freply%2F648284%23comment-form">register</a> to post comments</span></li> </ul> </div> </div> </div> </div></div></div></div> <ul class="forum-links"><li class="comment_forbidden"><span><a href="/user/login?destination=comment%2Freply%2F648284%23comment-form">Login</a> or <a href="/user/register?destination=comment%2Freply%2F648284%23comment-form">register</a> to post comments</span></li> </ul> </div> </div> </div> <!-- /main-content --> </div></div> <!-- /content-column --> <div id="sidebar-first" class="sidebar"> <div id="block-menu-menu-get-involved" class="block"> <div class="block-inner"> <h2>Get Involved</h2> <div class="content"><ul class="menu"> <li class="leaf first"><a href="/about-javanet" title="About java.net">About Java.net</a></li> <li class="leaf"><a href="http://java.net/projects/adoptajsr/pages/Home" title="Adopt">Adopt a JSR</a></li> <li class="leaf"><a href="/create-project" title="Create a Project">Create a Project</a></li> <li class="leaf last"><a href="/javanet-linking-instructions" title="Link an offiste project">Link an Offsite Project</a></li> </ul> </div> </div> </div> <!-- /block --> <div id="block-menu-menu-get-informed" class="block"> <div class="block-inner"> <h2>Get Informed</h2> <div class="content"><ul class="menu"> <li class="leaf first"><a href="/articles" title="">Articles</a></li> <li class="leaf"><a href="/blogfront" title="">Blogs</a></li> <li class="leaf"><a href="/events" title="">Events</a></li> <li class="leaf"><a href="http://www.oracle.com/technetwork/java/javamagazine/index.html?origref=http://java.net/projects/java-magazine" title="Subscribe to Java Magazine">Java Magazine</a></li> <li class="leaf last"><a href="http://education.oracle.com/pls/web_prod-plq-dad/ou_product_category.getFamilyPage?p_family_id=48&intcmp=WWOU11042412MPP012C010" title="Java Training and Certification at Oracle University">Oracle University</a></li> </ul> </div> </div> </div> <!-- /block --> </div> <!-- /sidebar-first --> </div></div> <!-- /columns --> <div id="tertiary-content"><div id="block-menu-menu-footer-menu" class="block"> <div class="block-inner"> <div class="content"><ul class="menu"> <li class="leaf first"><a href="/contact" title="">Feedback</a></li> <li class="leaf"><a href="/javanet-faq" title="">FAQ</a></li> <li class="leaf"><a href="/javanet-web-site-terms-use" title="">Terms of Use</a></li> <li class="leaf"><a href="http://www.oracle.com/us/legal/privacy/index.html" title="">Privacy</a></li> <li class="leaf last"><a href="http://www.oracle.com/us/legal/third-party-trademarks/index.html" title="">Trademarks</a></li> </ul> </div> </div> </div> <!-- /block --> </div> <!-- /tertiary-content --> <div id="footer"> <div id="footer-region"><div id="block-block-27" class="block"> <div class="block-inner"> <div class="content"><div style="width: 59%; float: left;"> <p>Your use of this web site or any of its content or software indicates your agreement to be bound by these <a href="/javanet-web-site-terms-use">Terms of Participation</a>.</p> <p>Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.</p> </div> <div style="width: 39%; float: left; text-align: right;"> <div style="float: right;"><a href="http://www.oracle.com"><img src="/sites/all/themes/java_adaptive/images/oracle.png"></a><a href="http://kenai.com"><img src="/sites/all/themes/java_adaptive/images/kenai.png"></a><a href="http://www.cognisync.com"><img src="/sites/all/themes/java_adaptive/images/cognisync.png"></a><br /> <div class="powered-by">Powered by Oracle, Project Kenai and Cognisync</div></div> </div></div> </div> </div> <!-- /block --> </div> <!-- /footer-region --> </div> <!-- /footer --> </div> <!-- /container --> <script type="text/javascript" src="/sites/all/modules/jquery_update/replace/jquery.min.js?X"></script> <script type="text/javascript" src="/misc/drupal.js?X"></script> <script type="text/javascript" src="/sites/all/modules/datetweaks/js/datetweaks.js?X"></script> <script type="text/javascript" src="/sites/all/modules/datetweaks/js/date-functions/date-functions.js?X"></script> <script type="text/javascript" src="/sites/all/modules/datetweaks/js/timepicker/jquery.timepicker.js?X"></script> <script type="text/javascript" src="/sites/all/modules/fivestar/js/fivestar.js?X"></script> <script type="text/javascript" src="/sites/all/modules/lightbox2/js/lightbox.js?X"></script> <script type="text/javascript" src="/sites/all/modules/panels/js/panels.js?X"></script> <script type="text/javascript" src="/sites/all/libraries/prettify/prettify.js?X"></script> <script type="text/javascript" src="/sites/all/modules/prettify/prettify.loader.js?X"></script> <script type="text/javascript" src="/sites/all/modules/extlink/extlink.js?X"></script> <script type="text/javascript" src="/sites/all/modules/custom_search/js/custom_search.js?X"></script> <script type="text/javascript" src="/sites/all/modules/ajax/jquery/jquery.a_form.packed.js?X"></script> <script type="text/javascript" src="/sites/all/modules/ajax/ajax.js?X"></script> <script type="text/javascript" src="/sites/all/themes/adaptivetheme/adaptivetheme/js/at-scripts.js?X"></script> <script type="text/javascript" src="/sites/all/themes/java_adaptive/js/java_custom.js?X"></script> <script type="text/javascript" src="/sites/all/themes/java_adaptive/js/forums.js?X"></script> <script type="text/javascript" src="/sites/all/themes/java_adaptive/js/java_search.js?X"></script> <script type="text/javascript" src="/sites/all/modules/ajax_views_refresh/ajax_views_refresh.js?X"></script> <script type="text/javascript"> <!--//--><![CDATA[//><!-- jQuery.extend(Drupal.settings, { "basePath": "/", "datetweaks": { "use_dropdown": true }, "fivestar": { "titleUser": "Your rating: ", "titleAverage": "Average: ", "feedbackSavingVote": "Saving your vote...", "feedbackVoteSaved": "Your vote has been saved.", "feedbackDeletingVote": "Deleting your vote...", "feedbackVoteDeleted": "Your vote has been deleted." }, "lightbox2": { "rtl": 0, "file_path": "/(\\w\\w/)sites/default/files", "default_image": "/sites/all/modules/lightbox2/images/brokenimage.jpg", "border_size": 0, "font_color": "000", "box_color": "fff", "top_position": "", "overlay_opacity": "0.8", "overlay_color": "000", "disable_close_click": 1, "resize_sequence": 0, "resize_speed": 400, "fade_in_speed": 400, "slide_down_speed": 600, "use_alt_layout": 1, "disable_resize": 0, "disable_zoom": 0, "force_show_nav": 0, "show_caption": 1, "loop_items": 0, "node_link_text": "View Image Details", "node_link_target": 0, "image_count": "Image !current of !total", "video_count": "Video !current of !total", "page_count": "Page !current of !total", "lite_press_x_close": "press \x3ca href=\"#\" onclick=\"hideLightbox(); return FALSE;\"\x3e\x3ckbd\x3ex\x3c/kbd\x3e\x3c/a\x3e to close", "download_link_text": "", "enable_login": false, "enable_contact": false, "keys_close": "c x 27", "keys_previous": "p 37", "keys_next": "n 39", "keys_zoom": "z", "keys_play_pause": "32", "display_image_size": "original", "image_node_sizes": "()", "trigger_lightbox_classes": "", "trigger_lightbox_group_classes": "", "trigger_slideshow_classes": "", "trigger_lightframe_classes": "", "trigger_lightframe_group_classes": "", "custom_class_handler": 0, "custom_trigger_classes": "", "disable_for_gallery_lists": true, "disable_for_acidfree_gallery_lists": true, "enable_acidfree_videos": true, "slideshow_interval": 5000, "slideshow_automatic_start": true, "slideshow_automatic_exit": true, "show_play_pause": true, "pause_on_next_click": false, "pause_on_previous_click": true, "loop_slides": false, "iframe_width": 900, "iframe_height": 700, "iframe_border": 1, "enable_video": 0 }, "prettify": { "linenums": false, "match": ".content", "nocode": "no-code", "custom": [ ], "markup": { "code": true, "pre": true, "precode": true } }, "extlink": { "extTarget": "_blank", "extClass": 0, "extSubdomains": 1, "extExclude": "", "extInclude": "", "extCssExclude": "", "extCssExplicit": "", "extAlert": 0, "extAlertText": "This link will take you to an external web site. We are not responsible for their content.", "mailtoClass": 0 }, "custom_search": { "form_target": "_self", "solr": 0 } }); //--><!]]> </script> <!-- Begin SiteCatalyst code --> <script language="JavaScript" src="/images/s_code_remote.js"></script> <script language="JavaScript"> <!-- var s_channel="other"; //--></script> <!-- End SiteCatalyst code --> <script type="text/javascript" src="/sites/all/modules/browserclass/browserclass.js?X"></script> <!-- 192.168.8.57 --> </body> </html>