Source Code Cross Referenced for MockServiceTreeNode.java in  » Web-Services » soapui-1.7.5 » com » eviware » soapui » model » tree » nodes » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Services » soapui 1.7.5 » com.eviware.soapui.model.tree.nodes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  soapUI, copyright (C) 2004-2007 eviware.com 
003:         *
004:         *  soapUI is free software; you can redistribute it and/or modify it under the 
005:         *  terms of version 2.1 of the GNU Lesser General Public License as published by 
006:         *  the Free Software Foundation.
007:         *
008:         *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
009:         *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
010:         *  See the GNU Lesser General Public License for more details at gnu.org.
011:         */
012:
013:        package com.eviware.soapui.model.tree.nodes;
014:
015:        import java.util.ArrayList;
016:        import java.util.List;
017:
018:        import com.eviware.soapui.model.mock.MockOperation;
019:        import com.eviware.soapui.model.mock.MockResponse;
020:        import com.eviware.soapui.model.mock.MockService;
021:        import com.eviware.soapui.model.mock.MockServiceListener;
022:        import com.eviware.soapui.model.tree.AbstractModelItemTreeNode;
023:        import com.eviware.soapui.model.tree.SoapUITreeModel;
024:        import com.eviware.soapui.model.tree.SoapUITreeNode;
025:        import com.eviware.soapui.settings.UISettings;
026:
027:        /**
028:         * SoapUITreeNode for MockService implementations
029:         * 
030:         * @author Ole.Matzura
031:         */
032:
033:        public class MockServiceTreeNode extends
034:                AbstractModelItemTreeNode<MockService> {
035:            private ReorderPropertyChangeListener propertyChangeListener = new ReorderPropertyChangeListener();
036:            private List<MockOperationTreeNode> mockOperationNodes = new ArrayList<MockOperationTreeNode>();
037:            private InternalMockServiceListener mockServiceListener;
038:
039:            public MockServiceTreeNode(MockService mockService,
040:                    SoapUITreeModel treeModel) {
041:                super (mockService, mockService.getProject(), treeModel);
042:
043:                mockServiceListener = new InternalMockServiceListener();
044:                mockService.addMockServiceListener(mockServiceListener);
045:
046:                for (int c = 0; c < mockService.getMockOperationCount(); c++) {
047:                    MockOperation mockOperation = mockService
048:                            .getMockOperationAt(c);
049:                    mockOperation.addPropertyChangeListener(
050:                            MockService.NAME_PROPERTY, propertyChangeListener);
051:                    mockOperationNodes.add(new MockOperationTreeNode(
052:                            mockOperation, getTreeModel()));
053:                }
054:
055:                initOrdering(mockOperationNodes, UISettings.ORDER_MOCKOPERATION);
056:
057:                getTreeModel().mapModelItems(mockOperationNodes);
058:            }
059:
060:            public void release() {
061:                super .release();
062:
063:                getModelItem().removeMockServiceListener(mockServiceListener);
064:
065:                for (MockOperationTreeNode treeNode : mockOperationNodes) {
066:                    treeNode.getModelItem().removePropertyChangeListener(
067:                            propertyChangeListener);
068:                    treeNode.release();
069:                }
070:            }
071:
072:            public MockService getMockService() {
073:                return (MockService) getModelItem();
074:            }
075:
076:            public int getChildCount() {
077:                return mockOperationNodes.size();
078:            }
079:
080:            public int getIndexOfChild(Object child) {
081:                return mockOperationNodes.indexOf(child);
082:            }
083:
084:            public SoapUITreeNode getChildNode(int index) {
085:                return mockOperationNodes.get(index);
086:            }
087:
088:            private final class InternalMockServiceListener implements 
089:                    MockServiceListener {
090:                public void mockOperationAdded(MockOperation mockOperation) {
091:                    MockOperationTreeNode mockOperationTreeNode = new MockOperationTreeNode(
092:                            mockOperation, getTreeModel());
093:                    mockOperationNodes.add(mockOperationTreeNode);
094:                    mockOperation
095:                            .addPropertyChangeListener(propertyChangeListener);
096:                    getTreeModel().notifyNodeInserted(mockOperationTreeNode);
097:                }
098:
099:                public void mockOperationRemoved(MockOperation mockOperation) {
100:                    SoapUITreeNode treeNode = getTreeModel().getTreeNode(
101:                            mockOperation);
102:                    if (mockOperationNodes.contains(treeNode)) {
103:                        getTreeModel().notifyNodeRemoved(treeNode);
104:                        mockOperation
105:                                .removePropertyChangeListener(propertyChangeListener);
106:                        mockOperationNodes.remove(treeNode);
107:                    } else
108:                        throw new RuntimeException(
109:                                "Removing unkown mockOperation");
110:                }
111:
112:                public void mockResponseAdded(MockResponse mockResponse) {
113:                    MockOperationTreeNode operationTreeNode = (MockOperationTreeNode) getTreeModel()
114:                            .getTreeNode(mockResponse.getMockOperation());
115:                    if (operationTreeNode != null)
116:                        operationTreeNode.mockResponseAdded(mockResponse);
117:                    else
118:                        throw new RuntimeException(
119:                                "Adding mockResponse to unknwown MockOperation");
120:                }
121:
122:                public void mockResponseRemoved(MockResponse mockResponse) {
123:                    MockOperationTreeNode operationTreeNode = (MockOperationTreeNode) getTreeModel()
124:                            .getTreeNode(mockResponse.getMockOperation());
125:                    if (operationTreeNode != null)
126:                        operationTreeNode.mockResponseRemoved(mockResponse);
127:                    else
128:                        throw new RuntimeException(
129:                                "Removing mockResponse from unknown MockOperation");
130:
131:                }
132:            }
133:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.