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

RoleMapElementTableModel

public class RoleMapElementTableModel extends AbstractTableModel
author
vkraemer
version

Fields Summary
RoleMapElement
v
private static ResourceBundle
bundle
Constructors Summary
public RoleMapElementTableModel(RoleMapElement rm)
Creates new RoleMapElementTableModel

 //NOI18N
    
        
       
        v = rm;
    
Methods Summary
public intgetColumnCount()

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

        if (0 == col) 
            return bundle.getString("COL_HEADER_BE_USERNAME");
        if (1 == col)
            return bundle.getString("COL_HEADER_BE_PASSWORD");
        if (2 == col) 
            return bundle.getString("COL_HEADER_BE_CREDENTIAL");
        if (3 == col)
            return bundle.getString("COL_HEADER_CONTAINER_USERNAMES");
        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 = null; 
        if (param1 != 3)
            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)

        RoleMapElement pe = new RoleMapElement(args);
        //if (null == args || 0 == args.length) {
        javax.swing.JTable tab = new javax.swing.JTable(new RoleMapElementTableModel(pe));
        javax.swing.table.TableColumnModel tcm = tab.getColumnModel();
        javax.swing.table.TableColumn tc = tcm.getColumn(1);
        //PasswordRenderEdit pre1 = new PasswordRenderEdit();
        PasswordRender pre2 = new PasswordRender();
        tc.setCellEditor(new javax.swing.DefaultCellEditor(new javax.swing.JPasswordField()));
        tc.setCellRenderer(pre2);
        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)

        if (col == 3)
            Reporter.info("val size = " + ((Vector)val).size() + " row = " + row + " column = " + col);
        int pre = v.getLength();
        v.setAttributeDetail(val, row, col); //NOI18N
        if (v.getLength() < pre) {
            Reporter.info("fireTableRowsDeleted");   //NOI18N
//            fireTableStructureChanged();
            fireTableRowsDeleted(row, row);
        }