1 19 package org.netbeans.modules.j2ee.websphere6.dd.loaders.ui; 20 21 import org.netbeans.modules.j2ee.websphere6.dd.beans.WSWebBnd; 23 import org.netbeans.modules.j2ee.websphere6.dd.loaders.webbnd.WSWebBndDataObject; 24 import org.netbeans.modules.xml.multiview.*; 25 import org.netbeans.modules.xml.multiview.ui.*; 26 27 31 public class WSWebBndAttributesForm extends WSWebBndAttributesPanel { 32 private final WSWebBnd webbnd; 33 private WSWebBndDataObject dObj; 34 35 36 private class NameEditorModel extends TextItemEditorModel { 37 38 public NameEditorModel(XmlMultiViewDataSynchronizer synchronizer) { 39 super(synchronizer, true, true); 40 } 41 42 protected String getValue() { 43 return webbnd.getXmiId(); 44 } 45 46 protected void setValue(String value) { 47 webbnd.setXmiId(value); 48 } 49 } 50 private class VirtualHostNameEditorModel extends TextItemEditorModel { 51 52 public VirtualHostNameEditorModel(XmlMultiViewDataSynchronizer synchronizer) { 53 super(synchronizer, true, true); 54 } 55 56 protected String getValue() { 57 return webbnd.getVirtualHostName(); 58 } 59 60 protected void setValue(String value) { 61 webbnd.setVirtualHostName(value); 62 } 63 } 64 public WSWebBndAttributesForm(SectionView sectionView, WSWebBndDataObject dObj, final WSWebBnd webbnd) { 65 super(sectionView,dObj,webbnd); 66 this.dObj = dObj; 67 this.webbnd = webbnd; 68 XmlMultiViewDataSynchronizer synchronizer = dObj.getModelSynchronizer(); 69 addRefreshable(new ItemEditorHelper(getNameField(), new NameEditorModel(synchronizer))); 70 addRefreshable(new ItemEditorHelper(getVirtualHostNameField(), new VirtualHostNameEditorModel(synchronizer))); 71 72 } 73 public void dataModelPropertyChange(Object source, String propertyName, Object oldValue, Object newValue) { 74 if (source instanceof WSWebBnd) { 75 scheduleRefreshView(); 76 } 77 } 78 } 79 | Popular Tags |