1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.actions.operation;
14
15 import java.awt.event.ActionEvent;
16
17 import javax.swing.AbstractAction;
18 import javax.swing.Action;
19
20 import com.eviware.soapui.impl.wsdl.WsdlOperation;
21 import com.eviware.soapui.support.UISupport;
22
23 /***
24 * Changes the label of a WsdlOperation as shown in SoapUI
25 *
26 * @author Ole.Matzura
27 */
28
29 public class RelabelOperationAction extends AbstractAction
30 {
31 private final WsdlOperation operation;
32
33 public RelabelOperationAction( WsdlOperation operation )
34 {
35 super( "Relabel" );
36 this.operation = operation;
37 putValue( Action.SHORT_DESCRIPTION, "Relabel this operation" );
38 putValue( Action.ACCELERATOR_KEY, UISupport.getKeyStroke( "F2" ));
39 }
40
41 public void actionPerformed(ActionEvent e)
42 {
43 String name = UISupport.prompt( "Specify label for operation\n(will not change underlying wsdl operation name)",
44 "Relabel Operation", operation.getName() );
45 if( name == null || name.equals( operation.getName() )) return;
46
47 operation.setName( name );
48 }
49
50 }