KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > changelog > wizard > OutputPanel


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 Ralph Krueger.
17  */

18
19
20 package org.netbeans.modules.changelog.wizard;
21
22 /**
23  *
24  * @author ralph
25  */

26
27 import org.openide.util.*;
28 import javax.swing.event.*;
29 import javax.swing.*;
30 import org.netbeans.modules.changelog.*;
31
32 import java.io.*;
33
34 public class OutputPanel extends javax.swing.JPanel JavaDoc {
35
36     /** Creates new form OutputPanel */
37     public OutputPanel() {
38         initComponents();
39         putClientProperty("WizardPanel_contentSelectedIndex", new Integer JavaDoc (1)); // NOI18N
40
ButtonGroup group = new ButtonGroup();
41         group.add(rbSortByDate);
42         group.add(rbSortByUser);
43         ButtonGroup group2 = new ButtonGroup();
44         group2.add(rbAscending);
45         group2.add(rbDescending);
46         btnXmlFile.setEnabled(false);// temporary
47
btnHtmlFile.setEnabled(false);// temporary
48
btnTextFile.setEnabled(false);// temporary
49
}
50     
51     /** This method is called from within the constructor to
52      * initialize the form.
53      * WARNING: Do NOT modify this code. The content of this method is
54      * always regenerated by the Form Editor.
55      */

56     private void initComponents() {//GEN-BEGIN:initComponents
57
java.awt.GridBagConstraints JavaDoc gridBagConstraints;
58
59         pnlSort = new javax.swing.JPanel JavaDoc();
60         lblSort = new javax.swing.JLabel JavaDoc();
61         rbSortByDate = new javax.swing.JRadioButton JavaDoc();
62         rbSortByUser = new javax.swing.JRadioButton JavaDoc();
63         lblOrder = new javax.swing.JLabel JavaDoc();
64         rbAscending = new javax.swing.JRadioButton JavaDoc();
65         rbDescending = new javax.swing.JRadioButton JavaDoc();
66         lblInclude = new javax.swing.JLabel JavaDoc();
67         cbSummary = new javax.swing.JCheckBox JavaDoc();
68         cbQuery = new javax.swing.JCheckBox JavaDoc();
69         cbBranchNames = new javax.swing.JCheckBox JavaDoc();
70         pnlType = new javax.swing.JPanel JavaDoc();
71         cbTextFile = new javax.swing.JCheckBox JavaDoc();
72         txTextFile = new javax.swing.JTextField JavaDoc();
73         btnTextFile = new javax.swing.JButton JavaDoc();
74         cbXmlFile = new javax.swing.JCheckBox JavaDoc();
75         txXmlFile = new javax.swing.JTextField JavaDoc();
76         btnXmlFile = new javax.swing.JButton JavaDoc();
77         cbHtmlFile = new javax.swing.JCheckBox JavaDoc();
78         txHtmlFile = new javax.swing.JTextField JavaDoc();
79         btnHtmlFile = new javax.swing.JButton JavaDoc();
80         cbWindow = new javax.swing.JCheckBox JavaDoc();
81         cbOutputWindow = new javax.swing.JCheckBox JavaDoc();
82
83         setLayout(new java.awt.GridBagLayout JavaDoc());
84
85         setMinimumSize(new java.awt.Dimension JavaDoc(400, 200));
86         setPreferredSize(new java.awt.Dimension JavaDoc(400, 200));
87         getAccessibleContext().setAccessibleName(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACSN_OutputPanel"));
88         getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACSD_OutputPanel"));
89         pnlSort.setLayout(new java.awt.GridBagLayout JavaDoc());
90
91         pnlSort.setMinimumSize(new java.awt.Dimension JavaDoc(553, 98));
92         lblSort.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_lblSort_mnc").charAt(0));
93         lblSort.setLabelFor(rbSortByDate);
94         lblSort.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("HtmlPanel.lblSort.text"));
95         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
96         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
97         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 0);
98         pnlSort.add(lblSort, gridBagConstraints);
99
100         rbSortByDate.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_rbSortByDate_mnc").charAt(0));
101         rbSortByDate.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.rbSortByDate.title"));
102         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
103         gridBagConstraints.gridx = 0;
104         gridBagConstraints.gridy = 1;
105         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
106         gridBagConstraints.insets = new java.awt.Insets JavaDoc(4, 6, 0, 6);
107         pnlSort.add(rbSortByDate, gridBagConstraints);
108
109         rbSortByUser.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_rbSortByUSer_mnc").charAt(0));
110         rbSortByUser.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.rbSortByUser.title"));
111         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
112         gridBagConstraints.gridx = 0;
113         gridBagConstraints.gridy = 2;
114         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
115         gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 6, 6, 6);
116         pnlSort.add(rbSortByUser, gridBagConstraints);
117
118         lblOrder.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_lblOrder_mnc").charAt(0));
119         lblOrder.setLabelFor(rbAscending);
120         lblOrder.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("HtmlPanel.lblOrder.text"));
121         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
122         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
123         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 0, 0, 6);
124         pnlSort.add(lblOrder, gridBagConstraints);
125
126         rbAscending.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_rbAscending_mnc").charAt(0));
127         rbAscending.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.rbAscending.title"));
128         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
129         gridBagConstraints.gridx = 1;
130         gridBagConstraints.gridy = 1;
131         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
132         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 0, 0, 6);
133         pnlSort.add(rbAscending, gridBagConstraints);
134
135         rbDescending.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_rbDescending_mnc").charAt(0));
136         rbDescending.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.rbDescending.title"));
137         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
138         gridBagConstraints.gridx = 1;
139         gridBagConstraints.gridy = 2;
140         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
141         gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 0, 6, 6);
142         pnlSort.add(rbDescending, gridBagConstraints);
143
144         lblInclude.setDisplayedMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_lblInclude_mnc").charAt(0));
145         lblInclude.setLabelFor(cbQuery);
146         lblInclude.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("HtmlPanel.lblInclude.text"));
147         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
148         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
149         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 12, 0, 6);
150         pnlSort.add(lblInclude, gridBagConstraints);
151
152         cbSummary.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbSummary_mnc").charAt(0));
153         cbSummary.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbSummary.title"));
154         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
155         gridBagConstraints.gridx = 2;
156         gridBagConstraints.gridy = 2;
157         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
158         gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 12, 0, 6);
159         pnlSort.add(cbSummary, gridBagConstraints);
160
161         cbQuery.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbQuery_mnc").charAt(0));
162         cbQuery.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbQuery.title"));
163         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
164         gridBagConstraints.gridx = 2;
165         gridBagConstraints.gridy = 1;
166         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
167         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 12, 0, 6);
168         pnlSort.add(cbQuery, gridBagConstraints);
169
170         cbBranchNames.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbBranchNames_mnc").charAt(0));
171         cbBranchNames.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbBranchNames.title"));
172         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
173         gridBagConstraints.gridx = 2;
174         gridBagConstraints.gridy = 3;
175         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
176         gridBagConstraints.weighty = 0.1;
177         gridBagConstraints.insets = new java.awt.Insets JavaDoc(2, 12, 0, 6);
178         pnlSort.add(cbBranchNames, gridBagConstraints);
179
180         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
181         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
182         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
183         gridBagConstraints.weightx = 0.5;
184         gridBagConstraints.weighty = 0.5;
185         gridBagConstraints.insets = new java.awt.Insets JavaDoc(12, 12, 0, 12);
186         add(pnlSort, gridBagConstraints);
187
188         pnlType.setLayout(new java.awt.GridBagLayout JavaDoc());
189
190         pnlType.setMinimumSize(new java.awt.Dimension JavaDoc(481, 124));
191         pnlType.setAutoscrolls(true);
192         cbTextFile.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbTextFile_mnc").charAt(0));
193         cbTextFile.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbTextFile.title"));
194         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
195         gridBagConstraints.gridx = 0;
196         gridBagConstraints.gridy = 0;
197         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
198         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
199         pnlType.add(cbTextFile, gridBagConstraints);
200
201         txTextFile.setMinimumSize(new java.awt.Dimension JavaDoc(150, 17));
202         txTextFile.setPreferredSize(new java.awt.Dimension JavaDoc(200, 17));
203         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
204         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
205         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
206         pnlType.add(txTextFile, gridBagConstraints);
207         txTextFile.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACSD_txTextFile"));
208
209         btnTextFile.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.btnTextFile.title"));
210         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
211         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
212         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
213         pnlType.add(btnTextFile, gridBagConstraints);
214
215         cbXmlFile.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbXmlFile_mnc").charAt(0));
216         cbXmlFile.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbHtmlFile.title"));
217         cbXmlFile.setLabel("XML File");
218         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
219         gridBagConstraints.gridx = 0;
220         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
221         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
222         pnlType.add(cbXmlFile, gridBagConstraints);
223
224         txXmlFile.setMinimumSize(new java.awt.Dimension JavaDoc(150, 17));
225         txXmlFile.setPreferredSize(new java.awt.Dimension JavaDoc(200, 17));
226         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
227         gridBagConstraints.gridx = 1;
228         gridBagConstraints.gridy = 1;
229         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
230         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
231         pnlType.add(txXmlFile, gridBagConstraints);
232         txXmlFile.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACSD_txXmlFile"));
233
234         btnXmlFile.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.btnHtmlFile.title"));
235         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
236         gridBagConstraints.gridx = 2;
237         gridBagConstraints.gridy = 1;
238         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
239         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
240         pnlType.add(btnXmlFile, gridBagConstraints);
241
242         cbHtmlFile.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbHtmlFile_mnc").charAt(0));
243         cbHtmlFile.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbHtmlFile.title"));
244         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
245         gridBagConstraints.gridx = 0;
246         gridBagConstraints.gridy = 2;
247         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
248         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
249         pnlType.add(cbHtmlFile, gridBagConstraints);
250
251         txHtmlFile.setMinimumSize(new java.awt.Dimension JavaDoc(150, 17));
252         txHtmlFile.setPreferredSize(new java.awt.Dimension JavaDoc(200, 17));
253         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
254         gridBagConstraints.gridx = 1;
255         gridBagConstraints.gridy = 2;
256         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
257         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 0);
258         pnlType.add(txHtmlFile, gridBagConstraints);
259         txHtmlFile.getAccessibleContext().setAccessibleDescription(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACSD_txHtmlFile"));
260
261         btnHtmlFile.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.btnHtmlFile.title"));
262         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
263         gridBagConstraints.gridx = 2;
264         gridBagConstraints.gridy = 2;
265         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
266         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 0, 6);
267         pnlType.add(btnHtmlFile, gridBagConstraints);
268
269         cbWindow.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbWindow_mnc").charAt(0));
270         cbWindow.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbWindow.title"));
271         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
272         gridBagConstraints.gridx = 0;
273         gridBagConstraints.gridy = 4;
274         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
275         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 6, 6);
276         pnlType.add(cbWindow, gridBagConstraints);
277
278         cbOutputWindow.setMnemonic(java.util.ResourceBundle.getBundle("org/netbeans/modules/changelog/wizard/Bundle").getString("ACS_cbOutputWinow").charAt(0));
279         cbOutputWindow.setText(org.openide.util.NbBundle.getBundle(OutputPanel.class).getString("OutputPanel.cbOutputWindow.title"));
280         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
281         gridBagConstraints.gridx = 0;
282         gridBagConstraints.gridy = 3;
283         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
284         gridBagConstraints.weighty = 0.5;
285         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 6, 6, 6);
286         pnlType.add(cbOutputWindow, gridBagConstraints);
287
288         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
289         gridBagConstraints.gridx = 0;
290         gridBagConstraints.gridy = 1;
291         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
292         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
293         gridBagConstraints.weightx = 0.5;
294         gridBagConstraints.weighty = 0.1;
295         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 12, 12, 12);
296         add(pnlType, gridBagConstraints);
297
298     }//GEN-END:initComponents
299

300     // Variables declaration - do not modify//GEN-BEGIN:variables
301
private javax.swing.JTextField JavaDoc txHtmlFile;
302     private javax.swing.JPanel JavaDoc pnlType;
303     private javax.swing.JCheckBox JavaDoc cbHtmlFile;
304     private javax.swing.JCheckBox JavaDoc cbOutputWindow;
305     private javax.swing.JRadioButton JavaDoc rbDescending;
306     private javax.swing.JRadioButton JavaDoc rbAscending;
307     private javax.swing.JCheckBox JavaDoc cbQuery;
308     private javax.swing.JLabel JavaDoc lblSort;
309     private javax.swing.JTextField JavaDoc txXmlFile;
310     private javax.swing.JCheckBox JavaDoc cbSummary;
311     private javax.swing.JCheckBox JavaDoc cbTextFile;
312     private javax.swing.JLabel JavaDoc lblInclude;
313     private javax.swing.JLabel JavaDoc lblOrder;
314     private javax.swing.JButton JavaDoc btnTextFile;
315     private javax.swing.JCheckBox JavaDoc cbXmlFile;
316     private javax.swing.JRadioButton JavaDoc rbSortByDate;
317     private javax.swing.JButton JavaDoc btnXmlFile;
318     private javax.swing.JTextField JavaDoc txTextFile;
319     private javax.swing.JPanel JavaDoc pnlSort;
320     private javax.swing.JRadioButton JavaDoc rbSortByUser;
321     private javax.swing.JButton JavaDoc btnHtmlFile;
322     private javax.swing.JCheckBox JavaDoc cbBranchNames;
323     private javax.swing.JCheckBox JavaDoc cbWindow;
324     // End of variables declaration//GEN-END:variables
325

326
327     public static class Panel implements org.openide.WizardDescriptor.FinishPanel {
328
329
330         private OutputPanel panel;
331         private String JavaDoc name;
332
333
334         public Panel (String JavaDoc name) {
335             this.name = name;
336         }
337
338
339         /** Get the component displayed in this panel.
340          * @return the component
341          */

342         public synchronized java.awt.Component JavaDoc getComponent() {
343             if (this.panel == null) {
344                 this.panel = new OutputPanel ();
345                 this.panel.setName (name);
346             }
347             return this.panel;
348         }
349
350         /** Help for this panel.
351          * When the panel is active, this is used as the help for the wizard dialog.
352          * @return the help or <code>null</code> if no help is supplied
353          */

354         public HelpCtx getHelp() {
355             return new HelpCtx(this.getClass());
356         }
357
358         /** Add a listener to changes of the panel's validity.
359          * @param l the listener to add
360          * @see #isValid
361          */

362         public void addChangeListener(ChangeListener l) {
363         }
364
365
366         /** Remove a listener to changes of the panel's validity.
367          * @param l the listener to remove
368          */

369         public void removeChangeListener(ChangeListener l) {
370         }
371
372         public boolean isValid() {
373             return true;
374         }
375
376         /** Provides the wizard panel with the current data--either
377          * the default data or already-modified settings, if the user used the previous and/or next buttons.
378          * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
379          * @param settings the object representing wizard panel state, as originally supplied to {@link org.openide.WizardDescriptor#WizardDescriptor(org.openide.WizardDescriptor.Iterator,Object)}
380          * @exception IllegalStateException if the the data provided
381          * by the wizard are not valid.
382          */

383         public void readSettings(Object JavaDoc settings) {
384             if (settings instanceof ChangeLogProcessor) {
385                 OutputPanel p = (OutputPanel) this.getComponent();
386                 ChangeLogProcessor proces = (ChangeLogProcessor)settings;
387                 if (proces.getToTextFile() != null) {
388                     p.txTextFile.setText(proces.getToTextFile().getAbsolutePath());
389                     p.cbTextFile.setSelected(true);
390                 } else {
391                     p.cbTextFile.setSelected(false);
392                     p.txTextFile.setText("");
393                 }
394                 if (proces.getToHtmlFile() != null) {
395                     p.txHtmlFile.setText(proces.getToHtmlFile().getAbsolutePath());
396                     p.cbHtmlFile.setSelected(true);
397                 } else {
398                     p.cbHtmlFile.setSelected(false);
399                     p.txHtmlFile.setText("");
400                 }
401                 if (proces.getToXmlFile() != null) {
402                     p.txXmlFile.setText(proces.getToXmlFile().getAbsolutePath());
403                     p.cbXmlFile.setSelected(true);
404                 } else {
405                     p.cbXmlFile.setSelected(false);
406                     p.txXmlFile.setText("");
407                 }
408                 p.cbOutputWindow.setSelected(proces.isToOutputWindow());
409                 p.cbWindow.setSelected(proces.isViewInBrowser());
410                 if (proces.getSortMode() == ChangeLogProcessor.SORT_BY_USER) {
411                     p.rbSortByUser.setSelected(true);
412                 } else
413                     if (proces.getSortMode() == ChangeLogProcessor.SORT_BY_DATE) {
414                         p.rbSortByDate.setSelected(true);
415                     }
416                 if (proces.isDescendingSort()) {
417                     p.rbDescending.setSelected(true);
418                 } else {
419                     p.rbAscending.setSelected(true);
420                 }
421                 p.cbSummary.setSelected(proces.isIncludeSummary());
422                 p.cbQuery.setSelected(proces.isIncludeQueryDescription());
423                 p.cbBranchNames.setSelected(proces.isIncludeBranchNames());
424             }
425         }
426
427         /** Provides the wizard panel with the opportunity to update the
428          * settings with its current customized state.
429          * Rather than updating its settings with every change in the GUI, it should collect them,
430          * and then only save them when requested to by this method.
431          * Also, the original settings passed to {@link #readSettings} should not be modified (mutated);
432          * rather, the (copy) passed in here should be mutated according to the collected changes.
433          * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>.
434          * @param settings the object representing a settings of the wizard
435          */

436         public void storeSettings(Object JavaDoc settings) {
437             if (settings instanceof ChangeLogProcessor) {
438                 OutputPanel p = (OutputPanel) this.getComponent();
439                 ChangeLogProcessor proces = (ChangeLogProcessor)settings;
440                 proces.setToOutputWindow(p.cbOutputWindow.isSelected());
441                 if (p.cbTextFile.isSelected() && p.txTextFile.getText().length() > 0) {
442                     proces.setToTextFile(new File(p.txTextFile.getText()));
443                 } else {
444                     proces.setToTextFile(null);
445                 }
446                 if (p.cbXmlFile.isSelected() && p.txXmlFile.getText().length() > 0) {
447                     proces.setToXmlFile(new File(p.txXmlFile.getText()));
448                 } else {
449                     proces.setToXmlFile(null);
450                 }
451                 if (p.cbHtmlFile.isSelected() && p.txHtmlFile.getText().length() > 0) {
452                     proces.setToHtmlFile(new File(p.txHtmlFile.getText()));
453                 } else {
454                     proces.setToHtmlFile(null);
455                 }
456                 if (p.rbSortByDate.isSelected()) {
457                     proces.setSortMode(ChangeLogProcessor.SORT_BY_DATE);
458                 } else
459                     if (p.rbSortByUser.isSelected()) {
460                         proces.setSortMode(ChangeLogProcessor.SORT_BY_USER);
461                     }
462                 proces.setDescendingSort(p.rbDescending.isSelected());
463                 proces.setIncludeQueryDescription(p.cbQuery.isSelected());
464                 proces.setIncludeSummary(p.cbSummary.isSelected());
465                 proces.setViewInBrowser(p.cbWindow.isSelected());
466                 proces.setIncludeBranchNames(p.cbBranchNames.isSelected());
467             }
468         }
469     }
470
471 }
472
Popular Tags