1 19 27 28 package org.netbeans.modules.j2ee.sun.share.configbean.customizers; 29 30 import java.util.Collections ; 31 import java.util.List ; 32 33 import javax.swing.table.AbstractTableModel ; 34 import org.netbeans.modules.j2ee.sun.share.PrincipalNameMapping; 35 36 40 public class PrincipalTableModel extends SecurityMappingTableModel { 41 42 44 public PrincipalTableModel(List p, int columns) { 45 super(p, columns); 46 assert (columns >= 1 && columns <= 2); 47 } 48 49 51 public int addElement(PrincipalNameMapping entry) { 52 return super.addElement(entry); 53 } 54 55 public int replaceElement(PrincipalNameMapping oldEntry, PrincipalNameMapping newEntry) { 56 return super.replaceElement(oldEntry, newEntry); 57 } 58 59 public int removeElement(PrincipalNameMapping entry) { 60 return super.removeElement(entry); 61 } 62 63 public boolean contains(PrincipalNameMapping entry) { 64 return super.contains(entry); 65 } 66 67 public PrincipalNameMapping getElementAt(int rowIndex) { 68 return (PrincipalNameMapping) super.getRowElement(rowIndex); 69 } 70 71 73 public String getColumnName(int column) { 74 switch(column) { 75 case 0: 76 return SecurityRoleMappingCustomizer.customizerBundle.getString("LBL_PrincipalName"); case 1: 78 return SecurityRoleMappingCustomizer.customizerBundle.getString("LBL_ClassName"); } 80 return null; 81 } 82 83 85 protected Object getColumnValueFromRow(Object rowEntry, int columnIndex) { 86 Object result = null; 87 PrincipalNameMapping entry = (PrincipalNameMapping) rowEntry; 88 if(columnIndex == 0) { 89 result = entry.getPrincipalName(); 90 } else { 91 result = entry.getClassName(); 92 } 93 return result; 94 } 95 } 96 | Popular Tags |