The PluginResponseEditor view creates a custom Request Editor view, to be used for new message formats, or API-specific messages. The editor is displayed as a tab in the message editor panel.
The viewId
property defines the name of the view.
The annotated class must implement the EditorView
interface.
Sample Response Editor
package com.smartbear.ready.plugin.template.factories;
import com.eviware.soapui.model.ModelItem;
import com.eviware.soapui.plugins.auto.PluginResponseEditorView;
import com.eviware.soapui.support.editor.Editor;
import com.eviware.soapui.support.editor.views.AbstractXmlEditorView;
import com.eviware.soapui.support.editor.xml.XmlEditor;
import javax.swing.JComponent;
import javax.swing.JLabel;
/**
*
*/
@PluginResponseEditorView(viewId = "SampleResponseEditorView")
public class SampleResponseEditorView extends AbstractXmlEditorView {
private ModelItem modelItem;
public SampleResponseEditorView(Editor<?> editor, ModelItem modelItem) {
super("Sample Response Editor View", (XmlEditor) editor, "SampleResponseEditorView");
this.modelItem = modelItem;
}
@Override
public JComponent getComponent() {
return new JLabel(modelItem.getName());
}
@Override
public void setEditable(boolean enabled) {
}
@Override
public boolean saveDocument(boolean validate) {
return true;
}
}
import com.eviware.soapui.model.ModelItem;
import com.eviware.soapui.plugins.auto.PluginResponseEditorView;
import com.eviware.soapui.support.editor.Editor;
import com.eviware.soapui.support.editor.views.AbstractXmlEditorView;
import com.eviware.soapui.support.editor.xml.XmlEditor;
import javax.swing.JComponent;
import javax.swing.JLabel;
/**
*
*/
@PluginResponseEditorView(viewId = "SampleResponseEditorView")
public class SampleResponseEditorView extends AbstractXmlEditorView {
private ModelItem modelItem;
public SampleResponseEditorView(Editor<?> editor, ModelItem modelItem) {
super("Sample Response Editor View", (XmlEditor) editor, "SampleResponseEditorView");
this.modelItem = modelItem;
}
@Override
public JComponent getComponent() {
return new JLabel(modelItem.getName());
}
@Override
public void setEditable(boolean enabled) {
}
@Override
public boolean saveDocument(boolean validate) {
return true;
}
}