Actions give the user access to features, so you can use them for anything you want to allow your user to do.
They are displayed as menu items (either in a menu or in the context menu for ModelItem corresponding to the action).
Context Menu | Menu |
---|---|
|
|
Description
Actions are by default at the Project level, but it is possible to place them in any menu context you like, by setting the actionGroup, which is provided by the archetype.
Contents
Item | Description |
---|---|
actionGroup |
Popup menu to show in (see ActionGroups ). not available in ReadyAPI Test. |
toolbarPosition |
Which toolbar to show in. not available in ReadyAPI Test. |
beforeAction | Position in menu/toolbar. |
afterAction | Position in menu/toolbar. |
iconPath | Path to icon. |
toolbarIcon |
Icon to be shown in toolbar. not available in ReadyAPI Test. |
keyStroke | Keyboard shortcut. |
description | Description in tooltip. |
separatorBefore | Separator before menu item. |
separatorAfter | Separator after menu item. |
Note: | The annotated class must implement the SoapUIAction interface. |
When the action is invoked, the perform
method is called with the selected object.
Sample Action
package com.smartbear.ready.plugin.template.actions;
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.plugins.ActionConfiguration;
import com.eviware.soapui.support.UISupport;
import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
import com.google.inject.Inject;
@ActionConfiguration(actionGroup = "EnabledWsdlProjectActions", targetType = WsdlProject.class)
public class SampleJavaAction extends AbstractSoapUIAction<WsdlProject> {
@Inject
public SampleJavaAction() {
super("Sample Java Action", "A sample action at the project level");
}
@Override
public void perform(WsdlProject project, Object o) {
UISupport.showInfoMessage("Hello from project [" + project.getName() + "]!");
}
}
import com.eviware.soapui.impl.wsdl.WsdlProject;
import com.eviware.soapui.plugins.ActionConfiguration;
import com.eviware.soapui.support.UISupport;
import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
import com.google.inject.Inject;
@ActionConfiguration(actionGroup = "EnabledWsdlProjectActions", targetType = WsdlProject.class)
public class SampleJavaAction extends AbstractSoapUIAction<WsdlProject> {
@Inject
public SampleJavaAction() {
super("Sample Java Action", "A sample action at the project level");
}
@Override
public void perform(WsdlProject project, Object o) {
UISupport.showInfoMessage("Hello from project [" + project.getName() + "]!");
}
}