putValue(Action.SMALL_ICON, UISupport.createImageIcon("/recreate_request.gif"));
putValue(Action.SHORT_DESCRIPTION, "Recreates a default response from the schema");
}
public void actionPerformed(ActionEvent arg0) {
Operation operation = mockResponse.getMockOperation().getOperation();
if (operation == null) {
UISupport.showErrorMessage("Missing operation for this mock response");
return;
}
String response = mockResponse.getResponseContent();
if (response != null && response.trim().length() > 0
&& !UISupport.confirm("Overwrite current response?", "Recreate response")) {
return;
}
boolean createOptional = mockResponse.getSettings().getBoolean(
WsdlSettings.XML_GENERATION_ALWAYS_INCLUDE_OPTIONAL_ELEMENTS);
if (!createOptional) {
createOptional = UISupport.confirm("Create optional elements in schema?", "Create Request");
}
String req = operation.createResponse(createOptional);
if (req == null) {
UISupport.showErrorMessage("Response creation failed");
return;
}