Apache NetBeans
Apache NetBeans
Latest release

Apache NetBeans 23

Download

How Can I Hook Up JavaHelp to Property Sets or Individual Properties?

Generally speaking, you can implement HelpCtx.Provider for objects in your platform application to associate them with a JavaHelp context (page). For some reason, this approach does not work with node properties. You can set the "helpID" value to associate JavaHelp with an individual property or an entire set, as shown below:

For Individual Properties

// in the constructor of your property class
public LastNameProperty(String initialValue) {
    super("lastName", String.class, "Last Name", "The user's surname");

    // This is how you associate a given property with a help context.
    setValue("helpID", "my.help.ctx");
}

For a Set of Properties

@Override
protected Sheet createSheet() {
    Sheet s = super.createSheet();

    Sheet.Set ss = s.get(Sheet.PROPERTIES);
    if (ss == null) {
        ss = Sheet.createPropertiesSet();
        s.put(ss);
    }

    // Do this to specify help for a whole sheet set
    ss.setValue("helpID", "my.help.ctx");

    ss.put(new FirstNameProperty("Abe"));
    ss.put(new LastNameProperty("Lincoln"));

    return s;
}