blob: cc7144931d6534755d73fd46c3a388757c14844e [file] [log] [blame]
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//
= DevFaqJavaHelpForNodeProperties
:jbake-type: wiki
:jbake-tags: wiki, devfaq, needsreview
:jbake-status: published
:keywords: Apache NetBeans wiki DevFaqJavaHelpForNodeProperties
:description: Apache NetBeans wiki DevFaqJavaHelpForNodeProperties
:toc: left
:toc-title:
:syntax: true
== 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
[source,java]
----
// 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
[source,java]
----
@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;
}
----
=== Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.
This page was exported from link:http://wiki.netbeans.org/DevFaqJavaHelpForNodeProperties[http://wiki.netbeans.org/DevFaqJavaHelpForNodeProperties] ,
that was last modified by NetBeans user Jhavlin
on 2011-12-13T16:35:20Z.
*NOTE:* This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.