RequestInspector creates a custom Request Inspector tab, which is used to view or edit aspects of a request. It is displayed as a tab in the request editor.
Generally, this extension is combined with custom RequestFilter
or RequestTransport
to define specific aspects of a request.
The inspectorId
property defines the name of the inspector.
The annotated class must implement the EditorInspector
interface.
Sample Request Inspector
package com.smartbear.ready.plugin.template.factories;
import com.eviware.soapui.model.ModelItem;
import com.eviware.soapui.plugins.auto.PluginRequestInspector;
import com.eviware.soapui.support.editor.Editor;
import com.eviware.soapui.support.editor.EditorView;
import com.eviware.soapui.support.editor.inspectors.AbstractXmlInspector;
import com.eviware.soapui.support.editor.xml.XmlDocument;
import javax.swing.JComponent;
import javax.swing.JLabel;
/**
*
*/
@PluginRequestInspector(inspectorId = "SampleRequestInspector")
public class SampleRequestInspector extends AbstractXmlInspector {
private ModelItem modelItem;
public SampleRequestInspector(Editor<?> editor, ModelItem modelItem) {
super("Request Inspector", "A Request inspector", true, "SampleRequestInspector");
this.modelItem = modelItem;
}
@Override
public boolean isEnabledFor(EditorView<XmlDocument> view) {
return true;
}
@Override
public JComponent getComponent() {
return new JLabel(modelItem.getName() + ": " + modelItem.getDescription());
}
}
import com.eviware.soapui.model.ModelItem;
import com.eviware.soapui.plugins.auto.PluginRequestInspector;
import com.eviware.soapui.support.editor.Editor;
import com.eviware.soapui.support.editor.EditorView;
import com.eviware.soapui.support.editor.inspectors.AbstractXmlInspector;
import com.eviware.soapui.support.editor.xml.XmlDocument;
import javax.swing.JComponent;
import javax.swing.JLabel;
/**
*
*/
@PluginRequestInspector(inspectorId = "SampleRequestInspector")
public class SampleRequestInspector extends AbstractXmlInspector {
private ModelItem modelItem;
public SampleRequestInspector(Editor<?> editor, ModelItem modelItem) {
super("Request Inspector", "A Request inspector", true, "SampleRequestInspector");
this.modelItem = modelItem;
}
@Override
public boolean isEnabledFor(EditorView<XmlDocument> view) {
return true;
}
@Override
public JComponent getComponent() {
return new JLabel(modelItem.getName() + ": " + modelItem.getDescription());
}
}