This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204269 - TopComponent getHelpCtx() only fires when an editable component on the TopComponent is selected
Summary: TopComponent getHelpCtx() only fires when an editable component on the TopCom...
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Help System (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: PLATFORM
Depends on:
Blocks:
 
Reported: 2011-10-26 12:10 UTC by jhuber
Modified: 2011-11-24 14:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jhuber 2011-10-26 12:10:43 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_16
Runtime = Java HotSpot(TM) Client VM 14.2-b01

Steps to reproduce problem:

1. Create a new NetBeans platform application. 
2. Use the appropriate wizard to create/add a module to the application. 
3. Use the appropriate wizard to add a TopComponent (1)  to the new module. Have this TopComponent open with the application in the editor position. Add an editable component such as a JTextField to this TopComponent. 
4. Use the appropriate wizard to add a TopComponent (2)  to the new module. Have this TopComponent open with the application in the editor position. Leave this TopComponent empty. 
5. Use the appropriate wizard to add a JavaHelp Helpset to the module. Optionally add some text to the body of the newly created "-about.html" file to help identify your help set. 
6. Add the following code to TopComponent(1): 
@Override 
public HelpCtx getHelpCtx() { 
    String xx = ""; 
    return new HelpCtx(xx); 
} 

7. Set a breakpoint in the above method. 
8. Add the following code to layer.xml to work around issue 204265
   <folder name="Shortcuts"> 
        <file name="F1.shadow"> 
            <attr name="originalFile" stringvalue="Actions/Help/org-netbeans-modules-javahelp-HelpAction.instance"/> 
        </file> 
    </folder> 

8. Debug the application.  Click the on the TopComponent tabs to switch focus between the two TopComponents.  Click on the tab for TopComponent(1) to give it the focus (tab turns blue).  Pressing F1 does not fire getHelpCtx().
9. Click in the JTextField and press F1.  getHelpCtx fires and the breakpoint is reached.

Once the TopComponent(1) has been selected, pressing F1 should fire getHelpCtx.  As there may be context sensitive help to describe the functionality of the entire TopComponent, it should not be necessary to click in a specific component contained on the page in order to get getHelpCtx to fire. Also, if the TopComponent consists  of JLabels that are updated to display output data, it would not be possible to display a help page with F1 that could provide detailed info about the displayed data.
Comment 1 Jaroslav Havlin 2011-10-27 11:49:32 UTC
core-main/rev/1422d9ec2725
Comment 2 Tomas Danek 2011-11-24 14:22:42 UTC
verified in Product Version: NetBeans IDE Dev (Build 20111124-a83fb29c3b5e)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402
System: Mac OS X version 10.7.2 running on x86_64; MacRoman; en_US (nb)
User directory: /tmp/ud2
Cache directory: /tmp/ud2/var/cache