1 19 25 26 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.common; 27 28 import java.util.ArrayList ; 29 import java.util.Collection ; 30 import java.util.List ; 31 import java.util.ResourceBundle ; 32 import javax.swing.JLabel ; 33 import javax.swing.JPanel ; 34 import javax.swing.table.JTableHeader ; 35 import javax.swing.table.TableColumn ; 36 import javax.swing.table.TableColumnModel ; 37 import junit.framework.*; 38 import org.netbeans.modules.schema2beans.BaseBean; 39 40 import org.netbeans.modules.j2ee.sun.common.dd.webapp.WebProperty; 41 import org.netbeans.modules.j2ee.sun.common.dd.webapp.JspConfig; 42 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.data.*; 43 44 48 public class GenericTablePanelTest extends TestCase { 49 50 private static final ResourceBundle webappBundle = ResourceBundle.getBundle( 51 "org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp.Bundle"); 53 public void testSomething() { 54 ArrayList tableColumns = new ArrayList (3); 55 tableColumns.add(new GenericTableModel.AttributeEntry( 56 WebProperty.NAME, "LBL_Name", true)); tableColumns.add(new GenericTableModel.AttributeEntry( 58 WebProperty.VALUE, "LBL_Value", true)); tableColumns.add(new GenericTableModel.ValueEntry( 60 WebProperty.DESCRIPTION, "LBL_Description")); 62 GenericTableModel jspConfigModel = new GenericTableModel(JspConfig.PROPERTY, WebProperty.class, tableColumns); 64 jspConfigModel.setData(new JspConfig()); 65 Object objectArray[] = new Object [3]; 66 objectArray[0] = "Name1"; 67 objectArray[1] = "Value1"; 68 objectArray[2] = "Description1"; 69 jspConfigModel.addRow(objectArray); 70 jspConfigModel.alreadyExists(objectArray); 71 objectArray = new Object [3]; 72 objectArray[0] = "Name2"; 73 objectArray[1] = "Value2"; 74 objectArray[2] = "Description2"; 75 jspConfigModel.editRow(0, objectArray); 76 jspConfigModel.getColumnNames(); 77 jspConfigModel.getData(); 78 jspConfigModel.getDataBaseBean(); 79 jspConfigModel.getPropertyDefinitions(); 80 jspConfigModel.getRowCount(); 81 jspConfigModel.getValueAt(0,1); 82 jspConfigModel.getValues(0); 83 GenericTablePanel j, jspConfigPanel = new GenericTablePanel(jspConfigModel, 84 webappBundle, "JspConfigProperties", DynamicPropertyPanel.class, HelpContext.HELP_WEBAPP_JSPCONFIG_POPUP, 86 PropertyListMapping.getPropertyList(PropertyListMapping.WEBAPP_JSPCONFIG_PROPERTIES)); 87 j = jspConfigPanel; 88 j.setHeadingMnemonic('a'); 89 90 javax.swing.JFrame foo = new javax.swing.JFrame (); 91 foo.getContentPane().add(jspConfigPanel); 92 93 jspConfigPanel.getInputDialog(); 94 j.getInputDialog(objectArray); 95 jspConfigModel.removeRow(0); 96 97 } 98 99 public GenericTablePanelTest(java.lang.String testName) { 100 super(testName); 101 } 102 103 } 104 | Popular Tags |