1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean.customizers; 26 27 import java.util.ResourceBundle ; 28 29 import org.netbeans.modules.j2ee.sun.dd.api.CommonDDBean; 30 import org.netbeans.modules.j2ee.sun.dd.api.common.WebserviceEndpoint; 31 import org.netbeans.modules.j2ee.sun.dd.api.common.LoginConfig; 32 33 import org.netbeans.modules.j2ee.sun.share.configbean.ServletRef; 34 import org.netbeans.modules.j2ee.sun.share.configbean.StorageBeanFactory; 35 import org.netbeans.modules.j2ee.sun.share.configbean.customizers.common.GenericTableModel; 36 37 38 42 public class LoginConfigEntry extends GenericTableModel.TableEntry { 43 44 private static final ResourceBundle customizerBundle = ResourceBundle.getBundle( 45 "org.netbeans.modules.j2ee.sun.share.configbean.customizers.Bundle"); 47 public LoginConfigEntry() { 48 super(WebserviceEndpoint.LOGIN_CONFIG, customizerBundle.getString("LBL_AuthenticationMethod")); } 50 51 public Object getEntry(CommonDDBean parent) { 52 Object result = null; 53 54 CommonDDBean loginConfig = (CommonDDBean) parent.getValue(propertyName); 55 if(loginConfig != null) { 56 result = loginConfig.getValue(LoginConfig.AUTH_METHOD); 57 } 58 59 return result; 60 } 61 62 public void setEntry(CommonDDBean parent, Object value) { 63 if(value instanceof String && ((String ) value).length() == 0) { 66 value = null; 67 } 68 69 LoginConfig lc = (LoginConfig) parent.getValue(WebserviceEndpoint.LOGIN_CONFIG); 70 if(value != null) { 71 if(lc == null) { 72 WebserviceEndpoint endpoint = (WebserviceEndpoint) parent; 73 lc = endpoint.newLoginConfig(); 74 parent.setValue(propertyName, lc); 75 } 76 77 lc.setValue(LoginConfig.AUTH_METHOD, value); 78 } else { 79 if(lc != null) { 80 parent.setValue(WebserviceEndpoint.LOGIN_CONFIG, null); 81 } 82 } 83 } 84 85 public Object getEntry(CommonDDBean parent, int row) { 86 throw new UnsupportedOperationException (); 87 } 88 89 public void setEntry(CommonDDBean parent, int row, Object value) { 90 throw new UnsupportedOperationException (); 91 } 92 93 } 94 | Popular Tags |