alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.core.ui;

import java.awt.Component;
import javax.swing.event.ChangeListener;

import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;

/** Module selection panel allows user to enable/disable modules in setup wizard
 *
 * @author Vincent Brabant, cledantec, jrojcek, Jesse Glick
 */
public class ModuleSelectionWizardPanel implements WizardDescriptor.FinishPanel {

    /** aggregation, instance of UI component of this wizard panel */
    private ModuleSelectionPanel panelUI;

    /** Creates new form wizardFrame */
    public ModuleSelectionWizardPanel() {
    }
    
    /** Get the component displayed in this panel.
    * @return the component
    */
    public Component getComponent () {
        return getPanelUI();
    }

    /** Help for this panel.
    * When the panel is active, this is used as the help for the wizard dialog.
    * @return the help or null if no help is supplied
    */
    public HelpCtx getHelp () {
        // #44551 - remove help Id
        //return new HelpCtx("setupwizard.moduleselection"); // NOI18N
        return null;
    }

    /** Provides the wizard panel with the current data--either
    * the default data or already-modified settings, if the user used the previous and/or next buttons.
    * This method can be called multiple times on one instance of WizardDescriptor.Panel.
    * @param settings the object representing wizard panel state, as originally supplied to
    * {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}
    */
    
    public void readSettings (Object settings) {
        panelUI.initFromSettings(settings);
    }

    /** Provides the wizard panel with the opportunity to update the
    * settings with its current customized state.
    * Rather than updating its settings with every change in the GUI, it should collect them,
    * and then only save them when requested to by this method.
    * Also, the original settings passed to {@link #readSettings} should not be modified (mutated);
    * rather, the (copy) passed in here should be mutated according to the collected changes.
    * This method can be called multiple times on one instance of WizardDescriptor.Panel.
    * @param settings the object representing a settings of the wizard
    */
    public void storeSettings (Object settings) {
        panelUI.storeSettings(settings);
    }

    /** Test whether the panel is finished and it is safe to proceed to the next one.
    * If the panel is valid, the "Next" (or "Finish") button will be enabled.
    * @return true if the user has entered satisfactory information
    */
    public boolean isValid () {
        return true;
    }
    
    /** Add a listener to changes of the panel's validity.
    * @param l the listener to add
    * @see #isValid
    */
    public void addChangeListener (ChangeListener l) {
    }

    /** Remove a listener to changes of the panel's validity.
    * @param l the listener to remove
    */
    public void removeChangeListener (ChangeListener l) {
    }

    /** Accessor for UI component */
    private ModuleSelectionPanel getPanelUI() {
        if (panelUI == null) {
            panelUI = new ModuleSelectionPanel();
        }
        return panelUI;
    }
    
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.