KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > autoupdate > SetupWizardPanel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.autoupdate;
21
22 import java.awt.Component JavaDoc;
23 import javax.swing.event.ChangeListener JavaDoc;
24 import org.openide.WizardDescriptor;
25 import org.openide.util.HelpCtx;
26
27 /** This panel is part of Setup Wizard, and is installed dynamically through
28  * layers.
29  * In aggregation with its UI part, SetupPanel.
30  *
31  * @author Ales Kemr
32  */

33 public final class SetupWizardPanel implements WizardDescriptor.FinishablePanel {
34
35     /** aggregation, instance of UI component of this wizard panel */
36     private SetupPanel panelUI;
37
38     /** @return AWT component which represents UI of this wizard panel */
39     public Component JavaDoc getComponent() {
40         return getPanelUI();
41     }
42
43     /** @return help context of AU Setup wizard panel */
44     public HelpCtx getHelp () {
45         return new HelpCtx("setupwizard.autoupdate"); // NOI18N
46
}
47
48     /** Initializes UI part from read settings.
49     */

50     public void readSettings (Object JavaDoc settings) {
51         if (settings instanceof WizardDescriptor) {
52             getPanelUI().initFromSettings((WizardDescriptor)settings);
53         }
54     }
55
56     /** Does nothing in this impl.
57     */

58     public void storeSettings (Object JavaDoc settings) {
59     }
60
61     /** Always valid.
62      * @return always true.
63     */

64     public boolean isValid () {
65         return true;
66     }
67
68     /** Noop, as this wizard panel is always valid.
69     * @see #isValid
70     */

71     public void addChangeListener (ChangeListener JavaDoc l) {
72     }
73
74     /** Noop, as this wizard panel is always valid.
75     * @see #isValid
76     */

77     public void removeChangeListener (ChangeListener JavaDoc l) {
78     }
79     
80     /** @return UI component of this wizard panel. Creates new one if
81      * accessed for the first time
82      */

83     private SetupPanel getPanelUI () {
84         if (panelUI == null) {
85             panelUI = new SetupPanel();
86         }
87         return panelUI;
88     }
89
90     public boolean isFinishPanel() {
91         return true;
92     }
93
94 }
95
Popular Tags