1 19 24 25 package org.netbeans.modules.j2ee.sun.share.configbean.customizers.webservice; 26 27 import org.netbeans.modules.j2ee.sun.dd.api.common.WebserviceEndpoint; 28 29 30 36 public class EndpointMapping { 37 38 private WebserviceEndpoint endpoint; 39 private String displayText; 40 private boolean textOutOfDate; 41 42 public EndpointMapping(final WebserviceEndpoint e) { 43 endpoint = e; 44 displayText = buildDisplayText(); 45 } 46 47 public EndpointMapping(final WebserviceEndpoint e, final String display) { 48 endpoint = e; 49 displayText = display; 50 } 51 52 public String toString() { 53 if(textOutOfDate) { 54 displayText = buildDisplayText(); 55 } 56 57 return displayText; 58 } 59 60 public WebserviceEndpoint getEndpoint() { 61 return endpoint; 62 } 63 64 public void updateDisplayText() { 65 textOutOfDate = true; 66 } 67 68 private String buildDisplayText() { 69 String name = endpoint.getPortComponentName(); 70 StringBuffer resultBuf = new StringBuffer (128); 71 72 if(name != null && name.length() > 0) { 73 resultBuf.append(name); 74 } else { 75 resultBuf.append(WebServiceDescriptorCustomizer.bundle.getString("LBL_UntitledEndpoint")); 76 } 77 78 textOutOfDate = false; 79 return resultBuf.toString(); 80 } 81 } 82 | Popular Tags |