Although I've never tried it, I don't think you can define a help key binding for help at the Composite level (for example) and then expect to put the cursor in a form field defined in that Composite and press the help key to get context-sensitive help. I'm honestly not sure, though, so maybe it'd work...
Here's an example of one way to implement context-sensitive help in SWT. This (or rather similar methods not involving hard-coded help text) is the way I've seen it done most:
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/Demonstratesvariouslisteners.htmLook for the calls to "addHelpListener()", the "setData()" calls and the "helpRequested()" method.
You can also catch mouseover events and display help once the user hovers the mouse over a certain area for a certain length of time, in a manner similar to what Eclipse does with its context-sensitive help:
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/HowtoimplementhoverhelpfeedbackusingtheMouseTrackListener.htmI'm honestly not sure how accessible that is, or how JAWS or VoiceOver would know that the hovering help was present - perhaps Sina, Michael or Alex can answer that one.
In both cases, the event you get in the listener should contain a reference to the widget for which the help was requested. You might be able to get away with having a single help listener class, but in that case you'll need some sort of mapping from the widget (or data contained in the widget) to the appropriate help topic.
Google can be your friend in figuring these things out :) Hope this helps, Cheers Chris On Feb 25, 2011, at 8:44 PM, John J. Boyer wrote:
Thanks, Chris. I might use this for extended help, but I think that context-sensitive help is usually a short explanation of what a particular menu choice does and how to proceed, or an explanation ofsomething in the text. It seems to me that the most user-friendly way topresent this information would be with a dialog box with an OK button.This can be done using the SWT MessageBox class. Hsow much is this used in applications? When I tried presing F1 on some MSWord menu choices itcertainly was not what I got.Time for more dumb questions from someone who hasn't been coding in Javavery long. Answers from the experts will considerably speed up development. I imagine that I have to designate a listener for whatever key is usedfor help. Can I set this up for the whold GUI or do I have to do so forthe Braille view and Daisy view individually? Once the listener gets control, how does it determine where in the context it was called from? Thanks, John On Fri, Feb 25, 2011 at 04:26:14PM -0800, Chris von See wrote:Minor update: Desktop.browse() takes a URI, not a URL. Chris On Feb 25, 2011, at 4:19 PM, Chris von See wrote:If you want to implement basic HTML help you can display it using the java.awt.Desktop class in Java 1.6 - it has a browse() method that takes a URL argument. The URL can point to either a Web site serving help pages or to a local file. The Desktop.browse() method can be invoked by whatever means a user would use to invoke help (F1, for example) - you just need to be careful that whatever mechanism you use isn't already mapped to something else by the OS. Cheers Chris On Feb 25, 2011, at 3:46 PM, John J. Boyer wrote:Susan, I wouldn't worry too much about the frames, though I don't see why anyone bothers with them. The documentation you mention mibht be helpful. What I need is some information on context-sensitive help algorithms. If I have to come up with my own it will take longer. John On Fri, Feb 25, 2011 at 11:00:01AM -0700, Susan Jolly wrote:I think you will need a library that interfaces with your GUI. SWTprovides context-sensitive help for Eclipse plug-ins but I don't know how it works when you use SWT outside of Eclipse. The online Eclipse documention seems to make a weird use of frames so I don't know how a screen reader would navigate it. I think what you want is something called Data Tools Platform Help-Helper Documentataion which is a section in the DAta Tools Platform Plug-in Developer Guide. Susan-- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities-- John J. Boyer; President, Chief Software Developer Abilitiessoft, Inc. http://www.abilitiessoft.com Madison, Wisconsin USA Developing software for people with disabilities