KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > upgrade > gui > CertificatePanel


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * CertificatePanel.java
26  *
27  * Created on September 29, 2003, 2:07 PM
28  */

29
30 package com.sun.enterprise.tools.upgrade.gui;
31
32 /**
33  *
34  * @author prakash
35  */

36 import java.util.*;
37 import com.sun.enterprise.tools.upgrade.common.*;
38 import com.sun.enterprise.tools.upgrade.gui.util.*;
39 import java.util.logging.*;
40 import java.io.File JavaDoc;
41
42 import com.sun.enterprise.util.i18n.StringManager;
43 import com.sun.enterprise.tools.upgrade.logging.*;
44
45 public class CertificatePanel extends javax.swing.JPanel JavaDoc {
46
47     // Variables declaration - do not modify//
48
private javax.swing.JButton JavaDoc addDomainButton;
49     private javax.swing.JButton JavaDoc deleteDomainButton;
50     private javax.swing.JTable JavaDoc domainTable;
51     private DomainsTableModel domainsTableModel;
52     private javax.swing.JScrollPane JavaDoc domainTableScrollPane;
53
54     private CommonInfoModel commonInfoModel;
55     private javax.swing.JFrame JavaDoc parent = null;
56     private List domainNamesInTable = null;
57     private AddDomainDialog addDomainDialog = null;
58
59     private StringManager stringManager = StringManager.getManager("com.sun.enterprise.tools.upgrade.gui");
60     private Logger logger = com.sun.enterprise.tools.upgrade.common.CommonInfoModel.getDefaultLogger();
61
62
63     /** Creates new form CertificatePanel */
64     public CertificatePanel(CommonInfoModel model, javax.swing.JFrame JavaDoc parent) {
65         this.commonInfoModel = model;
66         this.parent = parent;
67         this.domainNamesInTable = new ArrayList();
68         initComponents();
69     }
70
71     /** This method is called from within the constructor to
72      * initialize the form.
73      * WARNING: Do NOT modify this code. The content of this method is
74      * always regenerated by the Form Editor.
75      */

76     private void initComponents() {
77         java.awt.GridBagConstraints JavaDoc gridBagConstraints;
78
79         javax.swing.JPanel JavaDoc tablePanel = new javax.swing.JPanel JavaDoc();
80         domainTableScrollPane = new javax.swing.JScrollPane JavaDoc();
81         domainTable = new javax.swing.JTable JavaDoc();
82         addDomainButton = new javax.swing.JButton JavaDoc();
83         addDomainButton.addActionListener(new java.awt.event.ActionListener JavaDoc(){
84             public void actionPerformed(java.awt.event.ActionEvent JavaDoc ae){
85                 performAddDomainAction();
86             }
87         });
88         deleteDomainButton = new javax.swing.JButton JavaDoc();
89         deleteDomainButton.addActionListener(new java.awt.event.ActionListener JavaDoc(){
90             public void actionPerformed(java.awt.event.ActionEvent JavaDoc ae){
91                 performDeleteDomainAction();
92             }
93         });
94         javax.swing.JPanel JavaDoc dummyPanel1 = new javax.swing.JPanel JavaDoc();
95         javax.swing.JPanel JavaDoc dummyPanel2 = new javax.swing.JPanel JavaDoc();
96
97         javax.swing.JPanel JavaDoc dummyContentPanel = new javax.swing.JPanel JavaDoc();
98
99         this.setLayout(new java.awt.BorderLayout JavaDoc());
100         HeaderPanel headerPanel = new HeaderPanel(stringManager.getString("upgrade.gui.certpanel.headerPanel"));
101         headerPanel.setInsets(new java.awt.Insets JavaDoc(12, 10, 5, 10));
102         this.add(headerPanel, "North");
103
104         dummyContentPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
105         FlowLabel flowContentLabel = new FlowLabel();
106         flowContentLabel.setText(stringManager.getString("upgrade.gui.certpanel.flowContentLabel"));
107         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
108         gridBagConstraints.gridx = 0;
109         gridBagConstraints.gridy = 0;
110         gridBagConstraints.gridheight = 1;
111         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
112         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 10, 10, 10);
113         gridBagConstraints.weightx = 1.0;
114         gridBagConstraints.weighty = 0.0;
115         dummyContentPanel.add(flowContentLabel, gridBagConstraints);
116
117         tablePanel.setLayout(new java.awt.GridBagLayout JavaDoc());
118
119         tablePanel.setBorder(new javax.swing.border.TitledBorder JavaDoc(stringManager.getString("upgrade.gui.certpanel.certPanelTitle")));
120         domainsTableModel = new DomainsTableModel(domainNamesInTable);
121         domainTable.setModel(domainsTableModel);
122
123         domainTableScrollPane.setViewportView(domainTable);
124
125         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
126         gridBagConstraints.gridx = 0;
127         gridBagConstraints.gridy = 0;
128         gridBagConstraints.gridheight = 4;
129         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
130         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 5, 5, 5);
131         gridBagConstraints.weightx = 1.0;
132         gridBagConstraints.weighty = 1.0;
133         tablePanel.add(domainTableScrollPane, gridBagConstraints);
134
135         addDomainButton.setText(stringManager.getString("upgrade.gui.certpanel.addDomainButtonText"));
136         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
137         gridBagConstraints.gridx = 1;
138         gridBagConstraints.gridy = 1;
139         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 15, 10, 10);
140         tablePanel.add(addDomainButton, gridBagConstraints);
141
142         deleteDomainButton.setText(stringManager.getString("upgrade.gui.certpanel.deleteDomainButtonText"));
143         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
144         gridBagConstraints.gridx = 1;
145         gridBagConstraints.gridy = 2;
146         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 15, 10, 10);
147         tablePanel.add(deleteDomainButton, gridBagConstraints);
148
149         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
150         gridBagConstraints.gridx = 1;
151         gridBagConstraints.gridy = 0;
152         gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
153         gridBagConstraints.weighty = 0.5;
154         tablePanel.add(dummyPanel1, gridBagConstraints);
155
156         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
157         gridBagConstraints.gridx = 1;
158         gridBagConstraints.gridy = 3;
159         gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
160         gridBagConstraints.weighty = 0.5;
161         tablePanel.add(dummyPanel2, gridBagConstraints);
162
163         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
164         gridBagConstraints.gridx = 0;
165         gridBagConstraints.gridy = 1;
166         gridBagConstraints.gridheight = 1;
167         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
168         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 10, 10, 10);
169         gridBagConstraints.weightx = 1.0;
170         gridBagConstraints.weighty = 1.0;
171         dummyContentPanel.add(tablePanel, gridBagConstraints);
172
173         add(dummyContentPanel, java.awt.BorderLayout.CENTER);
174
175     }
176     void performAddDomainAction(){
177         getAddDomainDialog().clearFields();
178         getAddDomainDialog().setVisible(true);
179     }
180     void performDeleteDomainAction(){
181         int selRow = this.domainTable.getSelectedRow();
182         if(selRow != -1){
183             int option = javax.swing.JOptionPane.showConfirmDialog(this, stringManager.getString("upgrade.gui.certpanel.deleteConfirmMsg"),
184                               stringManager.getString("upgrade.gui.certpanel.deleteConfirmTitle"),
185                               javax.swing.JOptionPane.YES_NO_OPTION,
186                               javax.swing.JOptionPane.QUESTION_MESSAGE);
187             if (option == javax.swing.JOptionPane.NO_OPTION) {
188                 return;
189             }
190             commonInfoModel.setCertDbPassword((String JavaDoc)domainNamesInTable.get(selRow),"");
191             commonInfoModel.setJksKeystorePassword((String JavaDoc)domainNamesInTable.get(selRow),"");
192             domainsTableModel.removeDomain(selRow);
193         }
194     }
195     private AddDomainDialog getAddDomainDialog(){
196         if(this.addDomainDialog == null){
197             int sourceToTarget = 0;
198             if(this.commonInfoModel.isUpgradeNSStoJKS()){
199                 sourceToTarget = AddDomainDialog.NSStoJKS;
200             }else if(this.commonInfoModel.isUpgradeJKStoJKS()){
201                 sourceToTarget = AddDomainDialog.JKStoJKS;
202             }else if(this.commonInfoModel.isUpgradeJKStoNSS()){
203                 sourceToTarget = AddDomainDialog.JKStoNSS;
204             }else{
205                 sourceToTarget = AddDomainDialog.NSStoNSS; //NSS to NSS
206
}
207             
208             addDomainDialog = new AddDomainDialog(parent, true, commonInfoModel, sourceToTarget);
209             centerDialog(addDomainDialog);
210             addDomainDialog.addDialogListener(new DialogListener(){
211                 public void dialogProcessed(DialogEvent evt){
212                     processAddDomainDialogEvent(evt);
213                 }
214             });
215         }
216         return addDomainDialog;
217     }
218     public void reInitializeAddDomainDialog(){
219         this.addDomainDialog = null;
220     }
221     public void centerDialog(javax.swing.JDialog JavaDoc dialog) {
222         java.awt.Rectangle JavaDoc bounds = parent.getBounds();
223
224         java.awt.Rectangle JavaDoc dialogLocation = new java.awt.Rectangle JavaDoc();
225         dialogLocation.x = bounds.x+((bounds.width-dialog.getWidth())/2);
226         dialogLocation.y = bounds.y+((bounds.height-dialog.getHeight())/2);
227         dialogLocation.setSize(dialog.getWidth(),dialog.getHeight());
228         dialog.setBounds(dialogLocation);
229
230     }
231     private java.util.List JavaDoc processv70PESEto8xPE(String JavaDoc selectedDomainName, String JavaDoc selectedInstanceName, String JavaDoc pwd1, String JavaDoc pwd2, String JavaDoc pwd3){
232         // Here call a post validation of passwords and their setting in commonInfoModel has to be made.
233
// Whatever validation is done in CLI should be done here. Instead of doing validation in two places, the validation code
234
// can be moved to UpgradeUtils (avoid doing it in CommonInfoModel (just a data holder)).
235
// You can call this UpgradeUtils.... method from both CLI and here.
236

237         // If there are no errors, retun null from this method. If there are errors, get the localized error message and erro title
238
// and return them as a list. list.get(0) should be the message, hand list.get(1) should be title of error message.
239
commonInfoModel.setCurrentDomain(selectedDomainName);
240         commonInfoModel.setCurrentSourceInstance(selectedInstanceName);
241         commonInfoModel.setCertDbPassword(pwd1);
242         boolean validpwd = PasswordVerifier.verifySourceNSSPassword(commonInfoModel);
243         if(!validpwd) {
244             commonInfoModel.recover();
245             List errorList = new ArrayList();
246             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidNSSPWDMsg"));
247             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidNSSPWDTitle"));
248             return errorList;
249         }
250
251         commonInfoModel.setJksKeystorePassword(pwd2);
252         String JavaDoc jksPath=commonInfoModel.getTargetJKSKeyStorePath();
253         validpwd = PasswordVerifier.verifyKeystorePassword(jksPath,pwd2 );
254         if(!validpwd) {
255             commonInfoModel.recover();
256             List errorList = new ArrayList();
257             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidJKSPWDMsg"));
258             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidJKSPWDTitle"));
259             return errorList;
260         }
261
262         commonInfoModel.setJksCAKeystorePassword(pwd3);
263         String JavaDoc trustJksPath=commonInfoModel.getTargetTrustedJKSKeyStorePath();
264         validpwd = PasswordVerifier.verifyKeystorePassword(trustJksPath,pwd3 );
265         if(!validpwd) {
266             commonInfoModel.recover();
267             List errorList = new ArrayList();
268             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidCAPWDMsg"));
269             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidCAPWDTitle"));
270             return errorList;
271         }
272         return null;
273     }
274     private java.util.List JavaDoc processv8xPEto8xSEEE(String JavaDoc selectedDomainName, String JavaDoc pwd1, String JavaDoc pwd2, String JavaDoc pwd3){
275         // Follow the above for rest of the methods.
276
commonInfoModel.setCurrentDomain(selectedDomainName);
277         commonInfoModel.setCertDbPassword(pwd3);
278         commonInfoModel.setTargetCertDbPassword(pwd3);
279         boolean validpwd = PasswordVerifier.verifyTargetNSSPassword(commonInfoModel,commonInfoModel.getTargetConfig());
280         if(!validpwd) {
281             commonInfoModel.recover();
282             List errorList = new ArrayList();
283             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidTargetNSSPWDMsg"));
284             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidTargetNSSPWDTitle"));
285             return errorList;
286         }
287         commonInfoModel.setJksKeystorePassword(pwd1);
288         String JavaDoc jksPath=commonInfoModel.getSourceJKSKeyStorePath();
289         validpwd = PasswordVerifier.verifyKeystorePassword(jksPath,pwd1 );
290         if(!validpwd) {
291             commonInfoModel.recover();
292             List errorList = new ArrayList();
293             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidJKSPWDMsg"));
294             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidJKSPWDTitle"));
295             return errorList;
296         }
297         commonInfoModel.setJksCAKeystorePassword(pwd2);
298         String JavaDoc trustJksPath=commonInfoModel.getSourceTrustedJKSKeyStorePath();
299         validpwd = PasswordVerifier.verifyKeystorePassword(trustJksPath,pwd2 );
300         if(!validpwd) {
301             commonInfoModel.recover();
302             List errorList = new ArrayList();
303             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidCAPWDMsg"));
304             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidCAPWDTitle"));
305             return errorList;
306         }
307         return null;
308     }
309     private java.util.List JavaDoc processv80PEto81PE(String JavaDoc selectedDomainName, String JavaDoc pwd1, String JavaDoc pwd2){
310         commonInfoModel.setCurrentDomain(selectedDomainName);
311         commonInfoModel.setJksKeystorePassword(pwd1);
312         String JavaDoc jksPath=commonInfoModel.getSourceJKSKeyStorePath();
313         boolean validpwd = PasswordVerifier.verifyKeystorePassword(jksPath,pwd1 );
314         if(!validpwd) {
315             commonInfoModel.recover();
316             List errorList = new ArrayList();
317             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidJKSPWDMsg"));
318             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidJKSPWDTitle"));
319             return errorList;
320         }
321
322         commonInfoModel.setJksCAKeystorePassword(pwd2);
323         String JavaDoc trustJksPath=commonInfoModel.getSourceTrustedJKSKeyStorePath();
324         validpwd = PasswordVerifier.verifyKeystorePassword(trustJksPath,pwd2 );
325         if(!validpwd) {
326             commonInfoModel.recover();
327             List errorList = new ArrayList();
328             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidCAPWDMsg"));
329             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidCAPWDTitle"));
330             return errorList;
331         }
332         return null;
333     }
334     private java.util.List JavaDoc processv7xEEto90EE(String JavaDoc selectedDomainName, String JavaDoc selectedInstanceName, String JavaDoc pwd1, String JavaDoc pwd2){
335         commonInfoModel.setCurrentDomain(selectedDomainName);
336         commonInfoModel.setCurrentSourceInstance(selectedInstanceName);
337         commonInfoModel.setCertDbPassword(pwd1);
338         boolean validpwd = PasswordVerifier.verifySourceNSSPassword(commonInfoModel);
339         if(!validpwd) {
340             commonInfoModel.recover();
341             List errorList = new ArrayList();
342             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidNSSPWDMsg"));
343             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidNSSPWDTitle"));
344             return errorList;
345         }
346         commonInfoModel.setTargetCertDbPassword(pwd2);
347         validpwd = PasswordVerifier.verifyTargetNSSPassword(commonInfoModel,commonInfoModel.getTargetConfig());
348         if(!validpwd) {
349             commonInfoModel.recover();
350             List errorList = new ArrayList();
351             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidTargetNSSPWDMsg"));
352             errorList.add(stringManager.getString("upgrade.gui.certpanel.invalidTargetNSSPWDTitle"));
353             return errorList;
354         }
355         return null;
356     }
357
358     private void processAddDomainDialogEvent(DialogEvent evt){
359         if(evt.getAction() == DialogEvent.CANCEL_ACTION){
360             addDomainDialog.setVisible(false);
361             addDomainDialog.dispose();
362         }if(evt.getAction() == DialogEvent.HELP_ACTION){
363             // process help action
364
}else if(evt.getAction() == DialogEvent.FINISH_ACTION){
365             java.util.Vector JavaDoc data = (java.util.Vector JavaDoc)evt.getObject();
366             int sourceToTargetVersion = ((Integer JavaDoc)data.get(0)).intValue();
367             if(data.get(1) == null || data.size() < 4){
368                 // log a error message and return.
369
javax.swing.JOptionPane.showMessageDialog(this,stringManager.getString("upgrade.gui.certpanel.chooseDomainMsg"),stringManager.getString("upgrade.gui.certpanel.chooseDomainTitle"),javax.swing.JOptionPane.ERROR_MESSAGE);
370                 return;
371             }
372             String JavaDoc domainTableEntry = (String JavaDoc)data.get(1);
373             if(commonInfoModel.getSourceVersion().equals(UpgradeConstants.VERSION_7X)) {
374                 domainTableEntry = domainTableEntry + ":" + (String JavaDoc)data.get(2);
375             }
376             if(!this.domainNamesInTable.contains(domainTableEntry)) {
377                 domainsTableModel.addDomain(domainTableEntry);
378                 commonInfoModel.addDomainOptionName(domainTableEntry);
379             }
380             if(sourceToTargetVersion == AddDomainDialog.NSStoJKS && (data.size() > 5)){
381                 java.util.List JavaDoc errorMessageList = this.processv70PESEto8xPE((String JavaDoc)data.get(1), (String JavaDoc)data.get(2), (String JavaDoc)data.get(3),(String JavaDoc)data.get(4),(String JavaDoc)data.get(5));
382                 if(errorMessageList != null){
383                     // messageList contains message and title of the error
384
javax.swing.JOptionPane.showMessageDialog(this, (String JavaDoc)errorMessageList.get(0),(String JavaDoc)errorMessageList.get(1),javax.swing.JOptionPane.ERROR_MESSAGE);
385                     return;
386                 }
387             }else if(sourceToTargetVersion == AddDomainDialog.JKStoNSS && (data.size() > 5)){
388                 java.util.List JavaDoc errorMessageList = this.processv8xPEto8xSEEE((String JavaDoc)data.get(1),(String JavaDoc)data.get(3),(String JavaDoc)data.get(4),(String JavaDoc)data.get(5));
389                 if(errorMessageList != null){
390                     // messageList contains message and title of the error
391
javax.swing.JOptionPane.showMessageDialog(this, (String JavaDoc)errorMessageList.get(0),(String JavaDoc)errorMessageList.get(1),javax.swing.JOptionPane.ERROR_MESSAGE);
392                     return;
393                 }
394             }else if(sourceToTargetVersion == AddDomainDialog.JKStoJKS && (data.size() > 4)){
395                 java.util.List JavaDoc errorMessageList = this.processv80PEto81PE((String JavaDoc)data.get(1),(String JavaDoc)data.get(3),(String JavaDoc)data.get(4));
396                 if(errorMessageList != null){
397                     // messageList contains message and title of the error
398
javax.swing.JOptionPane.showMessageDialog(this, (String JavaDoc)errorMessageList.get(0),(String JavaDoc)errorMessageList.get(1),javax.swing.JOptionPane.ERROR_MESSAGE);
399                     return;
400                 }
401             }else if(sourceToTargetVersion == AddDomainDialog.NSStoNSS && (data.size() > 4)){
402                 //AddDomainDialog.v70SEto81SE
403
java.util.List JavaDoc errorMessageList = this.processv7xEEto90EE((String JavaDoc)data.get(1),(String JavaDoc)data.get(2),(String JavaDoc)data.get(3), (String JavaDoc)data.get(4));
404                 if(errorMessageList != null){
405                     // messageList contains message and title of the error
406
javax.swing.JOptionPane.showMessageDialog(this, (String JavaDoc)errorMessageList.get(0),(String JavaDoc)errorMessageList.get(1),javax.swing.JOptionPane.ERROR_MESSAGE);
407                     return;
408                 }
409             } else {
410                 javax.swing.JOptionPane.showMessageDialog(this,stringManager.getString("upgrade.gui.certpanel.chooseDomainMsg"),stringManager.getString("upgrade.gui.certpanel.chooseDomainTitle"),javax.swing.JOptionPane.ERROR_MESSAGE);
411                 return;
412             }
413             addDomainDialog.setVisible(false);
414             addDomainDialog.dispose();
415         }
416     }
417     // Table model for exceptions table
418
class DomainsTableModel extends javax.swing.table.AbstractTableModel JavaDoc {
419     private List domains = null;
420     private String JavaDoc columnNames[] = {stringManager.getString("upgrade.gui.certpanel.tableColumnName")};
421     /**
422      * FileTableModel constructor comment.
423      */

424     public DomainsTableModel(List doms) {
425         super();
426             this.domains = doms;
427     }
428     public int getColumnCount() {
429         return columnNames.length;
430     }
431     public java.lang.String JavaDoc getColumnName(int column) {
432         return columnNames[column];
433     }
434
435     public int getRowCount() {
436         return domains.size();
437     }
438     public boolean isCellEditable(int row, int col) {
439         return false;
440     }
441     public Class JavaDoc getColumnClass(int c) {
442         return java.lang.String JavaDoc.class;
443     }
444     /**
445      * getValueAt method comment.
446      */

447     public Object JavaDoc getValueAt(int row, int col) {
448         return (String JavaDoc) domains.get(row);
449     }
450         public void removeDomain(int domainIndex){
451             if(domains.size() > domainIndex){
452                 domains.remove(domainIndex);
453                 fireTableDataChanged();
454             }
455         }
456         public void addDomain(String JavaDoc domainName){
457             if(domainName != null){
458                 domains.add(domainName);
459                 fireTableDataChanged();
460             }
461         }
462     }
463 }
464
Popular Tags