001/*****************************************************************************
002 * Copyright by The HDF Group.                                               *
003 * Copyright by the Board of Trustees of the University of Illinois.         *
004 * All rights reserved.                                                      *
005 *                                                                           *
006 * This file is part of the HDF Java Products distribution.                  *
007 * The full copyright notice, including terms governing use, modification,   *
008 * and redistribution, is contained in the COPYING file, which can be found  *
009 * at the root of the source code distribution tree,                         *
010 * or in https://www.hdfgroup.org/licenses.                                  *
011 * If you do not have access to either file, you may request a copy from     *
012 * help@hdfgroup.org.                                                        *
013 ****************************************************************************/
014
015package hdf.view.dialog;
016
017import org.eclipse.jface.preference.IPreferencePage;
018import org.eclipse.jface.preference.PreferenceNode;
019import org.eclipse.jface.resource.ImageDescriptor;
020
021/**
022 * UserOptionsDialog displays components for choosing user options.
023 */
024public class UserOptionsNode extends PreferenceNode {
025    private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(UserOptionsNode.class);
026    /**
027     * The name of the class that implements the <code>PreferencePage</code>
028     * bound to this <code>ExtendedPreferenceNode</code>
029     */
030    private String classname;
031
032    /**
033     * Creates an <code>UserOptionsNode</code> with the given id. The
034     * new node has nosubnodes.
035     *
036     * @param id the node id
037     */
038    public UserOptionsNode(String id) { super(id); }
039
040    /**
041     * Creates an <code>UserOptionsNode</code> with the given id,
042     * label, and image, and lazily-loaded preference page. The preference node
043     * assumes (sole) responsibility for disposing of the image; this will
044     * happen when the node is disposed.
045     *
046     * @param id the node id
047     * @param label the label used to display the node in the preference
048     *            dialog's tree
049     * @param image the image displayed left of the label in the preference
050     *            dialog's tree, or <code>null</code> if none
051     * @param className the class name of the preference page; this class must
052     *            implement <code>IPreferencePage</code>
053     */
054    public UserOptionsNode(String id, String label, ImageDescriptor image, String className)
055    {
056        super(id, label, image, className);
057        this.classname = className;
058    }
059
060    /**
061     * Creates an <code>UserOptionsNode</code> with the given id and
062     * preference page. The title of the preference page is used for the node
063     * label. The node will not have an image.
064     *
065     * @param id the node id
066     * @param preferencePage the preference page
067     */
068    public UserOptionsNode(String id, IPreferencePage preferencePage) { super(id, preferencePage); }
069}