net.javaprog.ui.wizard
Class JavaHelpSupport
java.lang.Object
net.javaprog.ui.wizard.JavaHelpSupport
- All Implemented Interfaces:
- ActionListener, EventListener
public class JavaHelpSupport
- extends Object
- implements ActionListener
Provides for a seamless integration of jwizz with JavaHelp. This class
implements ActionListener to listen for help request actions. In order
to activate JavaHelp for a specific Wizard instance, just call
enableHelp(Wizard, HelpBroker)
passing the Wizard instance
and the HelpBroker used to display the help:
//initialize Wizard instance
Wizard wizard = ...;
//initialize HelpBroker instance
HelpBroker hb = ...;
//set help ID using JavaHelp helper class
CSH.setHelpIDString(wizard, "myHelpID");
//activate JavaHelp
JavaHelpSupport.enableHelp(wizard, hb);
Note: If you want more precise help for single wizard steps,
you can also attach a help ID to each step component:
public class MyStep extends AbstractStep {
...
protected JComponent createComponent() {
//initialize step component
JComponent stepComponent = ...;
//set help ID using JavaHelp helper class
CSH.setHelpIDString(stepComponent, "myHelpID");
return stepComponent;
}
}
...
//activate JavaHelp
JavaHelpSupport.enableHelp(wizard, hb);
- Since:
- 0.1.1
- Author:
- Michael Rudolf
Field Summary |
protected javax.help.HelpBroker |
hb
|
protected Wizard |
wizard
|
Method Summary |
void |
actionPerformed(ActionEvent e)
Reacts to help request actions by notifying the HelpBroker to display
an appropriate help ID. |
static void |
enableHelp(Wizard wizard,
javax.help.HelpBroker hb)
Activates support for JavaHelp for the given Wizard instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
wizard
protected Wizard wizard
hb
protected javax.help.HelpBroker hb
actionPerformed
public void actionPerformed(ActionEvent e)
- Reacts to help request actions by notifying the HelpBroker to display
an appropriate help ID.
- Specified by:
actionPerformed
in interface ActionListener
enableHelp
public static void enableHelp(Wizard wizard,
javax.help.HelpBroker hb)
- Activates support for JavaHelp for the given Wizard instance. This
method registers an instance of JavaHelpSupport as an ActionListener
with the passed Wizard object.
- Parameters:
wizard
- the Wizard instance for which to enable helphb
- the HelpBroker that is responsible for displaying the help- See Also:
Wizard.enableHelp(ActionListener)