1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp; 26 27 import java.util.List ; 28 import java.util.ResourceBundle ; 29 30 import org.netbeans.modules.j2ee.sun.dd.api.CommonDDBean; 31 import org.netbeans.modules.j2ee.sun.dd.api.web.SunWebApp; 32 import org.netbeans.modules.j2ee.sun.dd.api.web.WebProperty; 33 34 import org.netbeans.modules.j2ee.sun.share.configbean.Utils; 35 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.ListMapping; 36 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.GenericTableModel; 37 38 39 43 public class PropertiesEntry extends GenericTableModel.TableEntry { 44 45 static final ResourceBundle bundle = ResourceBundle.getBundle( 46 "org.netbeans.modules.j2ee.sun.share.configbean.customizers.webapp.Bundle"); 48 public PropertiesEntry() { 49 this(SunWebApp.PROPERTY, bundle.getString("LBL_Properties")); } 51 52 public PropertiesEntry(String propertyName, String captionName) { 53 super(propertyName, captionName); 54 } 55 56 public Object getEntry(CommonDDBean parent) { 57 ListMapping listMap = null; 59 Object obj = parent.getValues(propertyName); 60 if(obj != null) { 61 WebProperty [] webProps = (WebProperty []) obj; 62 List properties = Utils.arrayToList(webProps); 63 listMap = new ListMapping(properties); 64 } 65 66 return listMap; 67 } 68 69 public void setEntry(CommonDDBean parent, Object value) { 70 List list = ((ListMapping) value).getList(); 71 WebProperty [] webProps = (WebProperty []) 72 Utils.listToArray(list, WebProperty.class); 73 parent.setValue(propertyName, webProps); 74 } 75 76 public Object getEntry(CommonDDBean parent, int row) { 77 throw new UnsupportedOperationException (); 78 } 79 80 public void setEntry(CommonDDBean parent, int row, Object value) { 81 throw new UnsupportedOperationException (); 82 } 83 } 84 | Popular Tags |