1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.model.tree.nodes;
14
15 import com.eviware.soapui.model.iface.Operation;
16 import com.eviware.soapui.model.tree.AbstractTreeNode;
17 import com.eviware.soapui.model.tree.SoapUITreeNode;
18
19 /***
20 * SoapUITreeNode for Operation implementations
21 *
22 * @author Ole.Matzura
23 */
24
25 public class OperationTreeNode extends AbstractTreeNode
26 {
27 public OperationTreeNode(Operation operation)
28 {
29 super( operation, operation.getInterface() );
30 }
31
32 public int getChildCount()
33 {
34 return getOperation().getRequestCount();
35 }
36
37 public int getIndexOfChild(Object child)
38 {
39 Operation operation = getOperation();
40 for( int c = 0; c < operation.getRequestCount(); c++ )
41 {
42 if( operation.getRequestAt( c ).getTreeNode() == child ) return c;
43 }
44
45 return -1;
46 }
47
48 public Operation getOperation()
49 {
50 return (Operation) getModelItem();
51 }
52
53 public SoapUITreeNode getChildNode(int index)
54 {
55 return getOperation().getRequestAt(index ).getTreeNode();
56 }
57 }