/**
* edit an entry
*/
public void edit() {
XRegistryAccesser xregistryAccesser = new XRegistryAccesser(
SearchAndEditWindow.this.engine);
if (this.docTypeComboBox.getText().equals("Host")) {
// Update Host
this.hide();
HostDescriptionRegistrationWindow hostWindow = HostDescriptionRegistrationWindow
.getInstance();
if (!hostWindow.isEngineSet()) {
hostWindow.setXBayaEngine(this.engine);
}
HostBean hostBean = xregistryAccesser.getHostBean(this.list
.getSelectedValue().getQname().toString());
if (hostBean != null) {
hostBean.setHostName(this.list
.getSelectedValue().getQname().getLocalPart());
hostWindow.show(hostBean);
} else {
this.engine.getErrorWindow().error(this.dialog.getDialog(), "Cannot get value from Xregistry");
}
} else if (this.docTypeComboBox.getText().equals("Application")) {
// Update Application
this.hide();
ApplicationDescriptionRegistrationWindow appWindow = ApplicationDescriptionRegistrationWindow
.getInstance();
if (!appWindow.isEngineSet()) {
appWindow.setXBayaEngine(this.engine);
}
ApplicationBean appBean = xregistryAccesser.getApplicationBean(
this.list.getSelectedValue().getQname().toString(),
this.list.getSelectedValue().getDescription());
if (appBean != null) {
appBean.setApplicationName(this.list.getSelectedValue().getQname().getLocalPart());
appBean.setObjectNamespace(this.list.getSelectedValue().getQname().getNamespaceURI());
appBean.setHostName(this.list.getSelectedValue().getDescription());
appWindow.show(appBean);
} else {
this.engine.getErrorWindow().error(this.dialog.getDialog(), "Cannot get value from Xregistry");
}
} else {
// Update Service
this.hide();
ServiceDescriptionRegistrationWindow serviceWindow = ServiceDescriptionRegistrationWindow
.getInstance();
if (!serviceWindow.isEngineSet()) {
serviceWindow.setXBayaEngine(this.engine);
}
ServiceBean serviceBean = xregistryAccesser
.getServiceBean(this.list.getSelectedValue().getQname());
if (serviceBean != null) {
serviceBean.setServiceName(this.list.getSelectedValue().getQname().getLocalPart());
serviceBean.setObjectNamespace(this.list.getSelectedValue().getQname().getNamespaceURI());