Source Code Cross Referenced for ServiceUserObject.java in  » UML » MetaBoss » com » metaboss » applications » designstudio » userobjects » 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 » UML » MetaBoss » com.metaboss.applications.designstudio.userobjects 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
002:        // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
003:        // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
004:        // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
005:        // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
006:        // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
007:        // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
008:        // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
009:        // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
010:        // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
011:        // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
012:        // POSSIBILITY OF SUCH DAMAGE.
013:        //
014:        // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
015:        package com.metaboss.applications.designstudio.userobjects;
016:
017:        import java.awt.event.ActionEvent;
018:        import java.util.ArrayList;
019:
020:        import javax.swing.JTabbedPane;
021:
022:        import com.metaboss.applications.designstudio.Application;
023:        import com.metaboss.applications.designstudio.BaseAction;
024:        import com.metaboss.applications.designstudio.BasePropertiesDialog;
025:        import com.metaboss.applications.designstudio.BaseUserObject;
026:        import com.metaboss.applications.designstudio.components.SeparatorAction;
027:        import com.metaboss.applications.designstudio.fieldstable.FieldsViewPanel;
028:        import com.metaboss.applications.designstudio.propertiesdialogs.ServicePropertiesDialog;
029:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
030:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EnterpriseModelPackage;
031:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Operation;
032:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Service;
033:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.ServiceClass;
034:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Servicemodule;
035:
036:        /*		BOService user object class 	*/
037:
038:        public class ServiceUserObject extends BaseUserObject {
039:            public static final int ADD_IMPLEMENTATION = 1;
040:            public static final int ADD_OPERATION = 2;
041:
042:            private Service mService = null;
043:            private AddNewImplementationAction mAddNewImplementationAction = new AddNewImplementationAction();
044:            private AddNewOperationAction mAddNewOperationAction = new AddNewOperationAction();
045:            private StudyDependenciesAction mShowDataTypeDependenciesAction = new StudyDependenciesAction();
046:
047:            public ServiceUserObject(Service pService) {
048:                super (pService, Application.SERVICEMODULESERVICE_ICON);
049:                mService = pService;
050:            }
051:
052:            public ServiceUserObject(Service pService, String pCaption,
053:                    int pMode) {
054:                super (pService, pCaption, pMode);
055:                mService = pService;
056:            }
057:
058:            // create new service
059:            public static void addNewService(Servicemodule pServiceModule)
060:                    throws Exception {
061:                new ServiceUserObject(null).addNewObject(
062:                        getObjectPackage(pServiceModule), pServiceModule
063:                                .getServices());
064:            }
065:
066:            public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
067:                EnterpriseModelPackage lEnterpriseModelPackage = pPackage
068:                        .getEnterpriseModel();
069:                ServiceClass lClass = lEnterpriseModelPackage.getService();
070:                return new ServiceUserObject(lClass.createService());
071:            }
072:
073:            // return object root node captions
074:            public String getRootNodeName() {
075:                return Application.getString("services_node");
076:            }
077:
078:            // convert tree element to an action code
079:            public int convertCaptionToAction(String pCaption) {
080:                if (pCaption.equals(Application
081:                        .getString("implementations_node")))
082:                    return ADD_IMPLEMENTATION;
083:                else if (pCaption.equals(Application
084:                        .getString("operations_node")))
085:                    return ADD_OPERATION;
086:                else
087:                    return super .convertCaptionToAction(pCaption);
088:            }
089:
090:            public Service getService() {
091:                return mService;
092:            }
093:
094:            // get object editor
095:            public BasePropertiesDialog getObjectEditor() {
096:                return new ServicePropertiesDialog();
097:            }
098:
099:            // fill actions list
100:            public void fillActionsList(ArrayList pList) {
101:                switch (mMode) {
102:                case ALL_ACTIONS:
103:                    super .fillActionsList(pList);
104:                    pList.add(new SeparatorAction());
105:                    pList.add(mAddNewImplementationAction);
106:                    pList.add(mAddNewOperationAction);
107:                    pList.add(new SeparatorAction());
108:                    pList.add(mShowDataTypeDependenciesAction);
109:                    break;
110:                case ADD_IMPLEMENTATION:
111:                    pList.add(mAddNewImplementationAction);
112:                    break;
113:                case ADD_OPERATION:
114:                    pList.add(mAddNewOperationAction);
115:                    break;
116:                }
117:            }
118:
119:            // add new BOServiceImplementation object
120:            private void addServiceImplementation() throws Exception {
121:                ServiceImplementationUserObject
122:                        .addNewServiceImplementation(mService);
123:            }
124:
125:            // add new BOOperation object
126:            private void addOperation() throws Exception {
127:                OperationUserObject.addNewOperation(mService);
128:            }
129:
130:            // add extra properties tabs
131:            public void addExtraPropertiesTabs(JTabbedPane pTabbedPane) {
132:                pTabbedPane.insertTab("Operations", null, new FieldsViewPanel(
133:                        mService, 4), null, 1);
134:            }
135:
136:            // returns true if drop object could be accepted
137:            public boolean canAcceptDropObject(BaseUserObject pUserObject,
138:                    boolean pCopy) {
139:                if (pUserObject != null) {
140:                    if ((pUserObject instanceof  OperationUserObject && (mMode == BaseUserObject.ALL_ACTIONS || mMode == ServiceUserObject.ADD_OPERATION))) {
141:                        return (pCopy) ? pUserObject.canDuplicate() : true;
142:                    }
143:                }
144:                return false;
145:            }
146:
147:            // acccept drop target in transaction
148:            protected void transactionalAccept(BaseUserObject pUserObject,
149:                    boolean pCopy) throws Exception {
150:                if (pUserObject != null) {
151:                    if (pUserObject instanceof  OperationUserObject) {
152:                        OperationUserObject lUserObject = (OperationUserObject) pUserObject;
153:                        if (pCopy) {
154:                            Operation lOperation = (Operation) Application.sModelRepository
155:                                    .duplicateModelElement(lUserObject
156:                                            .getOperation());
157:                            lOperation.setService(mService);
158:                        } else
159:                            lUserObject.getOperation().setService(mService);
160:                    }
161:                }
162:            }
163:
164:            /*				Actions				*/
165:
166:            public class AddNewImplementationAction extends BaseAction {
167:                public AddNewImplementationAction() {
168:                    super ("Add New Implementation", Application
169:                            .getAddIcon(Application.SERVICEIMPL_ICON));
170:                }
171:
172:                public void actionPerformed(ActionEvent e) {
173:                    try {
174:                        addServiceImplementation();
175:                    } catch (Throwable t) {
176:                        Application.processError(t);
177:                    }
178:                }
179:            }
180:
181:            public class AddNewOperationAction extends BaseAction {
182:                public AddNewOperationAction() {
183:                    super ("Add New Operation", Application
184:                            .getAddIcon(Application.OPERATION_ICON));
185:                }
186:
187:                public void actionPerformed(ActionEvent e) {
188:                    try {
189:                        addOperation();
190:                    } catch (Throwable t) {
191:                        t.printStackTrace();
192:                    }
193:                }
194:            }
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.