KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > panels > SummaryPanel


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2005 Klaus Bartz
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package com.izforge.izpack.panels;
23
24 import javax.swing.JEditorPane JavaDoc;
25 import javax.swing.JScrollPane JavaDoc;
26
27 import com.izforge.izpack.gui.IzPanelLayout;
28 import com.izforge.izpack.installer.InstallData;
29 import com.izforge.izpack.installer.InstallerFrame;
30 import com.izforge.izpack.installer.IzPanel;
31 import com.izforge.izpack.util.SummaryProcessor;
32
33 /**
34  * Summary panel to use before InstallPanel. This panel calls the {@link SummaryProcessor} which
35  * calls all declared panels for a summary and shows the given captiond and messaged in a
36  * <code>JEditorPane</code>.
37  *
38  * @author Klaus Bartz
39  *
40  */

41 public class SummaryPanel extends IzPanel
42 {
43
44     /**
45      *
46      */

47     private static final long serialVersionUID = 3832626166401282361L;
48
49     /** The text area. */
50     private JEditorPane JavaDoc textArea;
51
52     /**
53      * The constructor.
54      *
55      * @param parent The parent.
56      * @param idata The installation data.
57      */

58     public SummaryPanel(InstallerFrame parent, InstallData idata)
59     {
60         super(parent, idata, new IzPanelLayout());
61         add(createMultiLineLabelLang("SummaryPanel.info"));
62         try
63         {
64             textArea = new JEditorPane JavaDoc();
65             textArea.setContentType("text/html");
66             textArea.setEditable(false);
67             JScrollPane JavaDoc scroller = new JScrollPane JavaDoc(textArea);
68             add(scroller, NEXT_LINE);
69         }
70         catch (Exception JavaDoc err)
71         {
72             err.printStackTrace();
73         }
74         getLayoutHelper().completeLayout();
75     }
76
77     /*
78      * (non-Javadoc)
79      *
80      * @see com.izforge.izpack.installer.IzPanel#panelActivate()
81      */

82     public void panelActivate()
83     {
84         super.panelActivate();
85         textArea.setText(SummaryProcessor.getSummary(idata));
86         textArea.setCaretPosition(0);
87     }
88
89 }
90
Popular Tags