FileDocCategorySizeDatePackage
PropertyElementsTableModel.javaAPI DocGlassfish v2 API4597Fri May 04 22:34:56 BST 2007com.sun.enterprise.tools.common.properties

PropertyElementsTableModel

public class PropertyElementsTableModel extends AbstractTableModel
author
vkraemer
version

Fields Summary
PropertyElements
v
private static ResourceBundle
bundle
Constructors Summary
public PropertyElementsTableModel(PropertyElements v)
Creates new PropertyElementsTableModel

 // NOI18N
    
        
       
        this.v = v;
    
Methods Summary
public intgetColumnCount()

        return v.getWidth();
    
public java.lang.StringgetColumnName(int col)

        if (0 == col) 
            return bundle.getString("COL_HEADER_NAME");
        if (1 == col)
            return bundle.getString("COL_HEADER_VALUE");
        throw new RuntimeException(bundle.getString("COL_HEADER_ERR_ERR_ERR"));
    
public intgetRowCount()

        return v.getLength() + 1;
    
public java.lang.ObjectgetValueAt(int param, int param1)

        Object retVal = ""; // NOI18N
        if (param < v.getLength())
            retVal = v.getAttributeDetail(param, param1); //NOI18N
        return retVal;
        //        return ra.getAttributeValue("PropertyElement", param, intToAttribute(param1)); //NOI18N
    
public booleanisCellEditable(int row, int col)

        return true;
    
public static voidmain(java.lang.String[] args)

        PropertyElements pe = new PropertyElements(args);
        //if (null == args || 0 == args.length) {
        javax.swing.JTable tab = new javax.swing.JTable(new PropertyElementsTableModel(pe));
        javax.swing.JScrollPane sp = new javax.swing.JScrollPane(tab);
        javax.swing.JFrame f = new javax.swing.JFrame();
        f.addWindowListener(new CloseTestWindow(pe));
        f.getContentPane().add(sp);
        f.show();
    
public voidsetValueAt(java.lang.Object val, int row, int col)

        int pre = v.getLength();
        v.setAttributeDetail(val, row, col); //NOI18N
        if (v.getLength() < pre) {
            // the length changed..  I may need to fire a 
            fireTableStructureChanged();
        }