Source Code Cross Referenced for ConditionProxyItemSemanticEditPolicy.java in  » Workflow-Engines » osbl-1_0 » newprocess » diagram » edit » policies » 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 » Workflow Engines » osbl 1_0 » newprocess.diagram.edit.policies 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package newprocess.diagram.edit.policies;
002:
003:        import newprocess.Conclusion;
004:        import newprocess.ConditionProxy;
005:        import newprocess.ConditionTerm;
006:        import newprocess.Expansion;
007:        import newprocess.NewprocessPackage;
008:        import newprocess.OperatorTerm;
009:        import newprocess.Root;
010:        import newprocess.diagram.cust.operation.ConditionProxyChainDeleteOperation;
011:        import newprocess.diagram.providers.New_processElementTypes;
012:
013:        import org.eclipse.emf.ecore.EAnnotation;
014:        import org.eclipse.emf.ecore.EObject;
015:        import org.eclipse.gef.commands.Command;
016:        import org.eclipse.gef.commands.UnexecutableCommand;
017:        import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
018:        import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
019:        import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
020:        import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
021:        import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
022:        import org.eclipse.gmf.runtime.notation.View;
023:
024:        /**
025:         * @generated
026:         */
027:        public class ConditionProxyItemSemanticEditPolicy extends
028:                New_processBaseItemSemanticEditPolicy {
029:
030:            /**
031:             * @generated NOT
032:             * @author sh
033:             */
034:            protected Command getDestroyElementCommand(DestroyElementRequest req) {
035:                return getMSLWrapper(new DestroyElementCommand(req) {
036:
037:                    protected EObject getElementToDestroy() {
038:                        View view = (View) getHost().getModel();
039:                        EAnnotation annotation = view
040:                                .getEAnnotation("Shortcut"); //$NON-NLS-1$
041:                        if (annotation != null) {
042:                            return view;
043:                        }
044:
045:                        // if the proxy should be deleted, also delete all linked terms
046:                        ConditionProxyChainDeleteOperation deleteOperation = new ConditionProxyChainDeleteOperation();
047:                        deleteOperation.doExecute(getHost());
048:
049:                        return super .getElementToDestroy();
050:                    }
051:
052:                });
053:            }
054:
055:            /**
056:             * @generated NOT
057:             * @author sh
058:             */
059:            protected Command getCreateRelationshipCommand(
060:                    CreateRelationshipRequest req) {
061:                if (New_processElementTypes.OperatorTermSubTerm_4003 == req
062:                        .getElementType()) {
063:                    if (req.getTarget() != null)
064:                        return getCreateCompleteIncomingOperatorTerm_ConditionProxyCommand(req);
065:                }
066:                if (New_processElementTypes.ConditionTermConditionProxy_4004 == req
067:                        .getElementType()) {
068:                    if (req.getTarget() == null)
069:                        return null; // proxy --> term
070:                    else
071:                        return getCreateCompleteIncomingConditionTerm_ConditionProxy4004Command(req);
072:                }
073:                if (New_processElementTypes.RootTerm_4002 == req
074:                        .getElementType()) {
075:                    if (req.getTarget() == null)
076:                        return null; // proxy --> root
077:                    else
078:                        return getCreateCompleteIncomingRoot_ConditionProxyCommand(req);
079:                }
080:                if (New_processElementTypes.ConclusionConclusionProxy_4005 == req
081:                        .getElementType()) {
082:                    return req.getTarget() == null ? null
083:                            : getCreateCompleteIncomingConclusion_ConclusionProxy4005Command(req);
084:                }
085:                if (New_processElementTypes.ExpansionExpansionProxy_4006 == req
086:                        .getElementType()) {
087:                    return req.getTarget() == null ? null
088:                            : getCreateCompleteIncomingExpansion_ExpansionProxy4006Command(req);
089:                }
090:                return super .getCreateRelationshipCommand(req);
091:            }
092:
093:            /**
094:             * @author sh
095:             * @param req
096:             * @return
097:             */
098:            protected Command getCreateCompleteIncomingOperatorTerm_ConditionProxyCommand(
099:                    CreateRelationshipRequest req) {
100:
101:                // check source and target objects
102:                EObject sourceEObject = req.getSource();
103:                EObject targetEObject = req.getTarget();
104:
105:                // if source is not an operator and target is not a proxy
106:                if (!(sourceEObject instanceof  OperatorTerm)
107:                        || !(targetEObject instanceof  ConditionProxy)) {
108:                    return UnexecutableCommand.INSTANCE;
109:                }
110:
111:                OperatorTerm source = (OperatorTerm) sourceEObject;
112:                ConditionProxy target = (ConditionProxy) targetEObject;
113:
114:                if (!New_processBaseItemSemanticEditPolicy.LinkConstraints
115:                        .canCreateOperatorTermConditionProxy(source, target)) {
116:                    return UnexecutableCommand.INSTANCE;
117:                }
118:
119:                return new Command() {
120:                };
121:            }
122:
123:            /**
124:             * @author sh
125:             * @param req
126:             * @return
127:             */
128:            protected Command getCreateCompleteIncomingRoot_ConditionProxyCommand(
129:                    CreateRelationshipRequest req) {
130:
131:                // check source and target objects
132:                EObject sourceEObject = req.getSource();
133:                EObject targetEObject = req.getTarget();
134:
135:                // if source is not an operator and target is not a proxy
136:                if (!(sourceEObject instanceof  Root)
137:                        || !(targetEObject instanceof  ConditionProxy)) {
138:                    return UnexecutableCommand.INSTANCE;
139:                }
140:
141:                Root source = (Root) sourceEObject;
142:                ConditionProxy target = (ConditionProxy) targetEObject;
143:
144:                if (!New_processBaseItemSemanticEditPolicy.LinkConstraints
145:                        .canCreateRootConditionProxy(source, target)) {
146:                    return UnexecutableCommand.INSTANCE;
147:                }
148:
149:                return new Command() {
150:                };
151:            }
152:
153:            /**
154:             * @generated
155:             */
156:            protected Command getCreateCompleteIncomingConditionTerm_ConditionProxy4004Command(
157:                    CreateRelationshipRequest req) {
158:                EObject sourceEObject = req.getSource();
159:                EObject targetEObject = req.getTarget();
160:                if (false == sourceEObject instanceof  ConditionTerm
161:                        || false == targetEObject instanceof  ConditionProxy) {
162:                    return UnexecutableCommand.INSTANCE;
163:                }
164:                ConditionTerm source = (ConditionTerm) sourceEObject;
165:                ConditionProxy target = (ConditionProxy) targetEObject;
166:                if (!New_processBaseItemSemanticEditPolicy.LinkConstraints
167:                        .canCreateConditionTermConditionProxy_4004(source,
168:                                target)) {
169:                    return UnexecutableCommand.INSTANCE;
170:                }
171:                SetRequest setReq = new SetRequest(req.getSource(),
172:                        NewprocessPackage.eINSTANCE
173:                                .getConditionTerm_ConditionProxy(), req
174:                                .getTarget());
175:                return getMSLWrapper(new SetValueCommand(setReq));
176:            }
177:
178:            /**
179:             * @generated
180:             */
181:            protected Command getCreateCompleteIncomingConclusion_ConclusionProxy4005Command(
182:                    CreateRelationshipRequest req) {
183:                EObject sourceEObject = req.getSource();
184:                EObject targetEObject = req.getTarget();
185:                if (false == sourceEObject instanceof  Conclusion
186:                        || false == targetEObject instanceof  ConditionProxy) {
187:                    return UnexecutableCommand.INSTANCE;
188:                }
189:                Conclusion source = (Conclusion) sourceEObject;
190:                ConditionProxy target = (ConditionProxy) targetEObject;
191:                if (!New_processBaseItemSemanticEditPolicy.LinkConstraints
192:                        .canCreateConclusionConclusionProxy_4005(source, target)) {
193:                    return UnexecutableCommand.INSTANCE;
194:                }
195:                SetRequest setReq = new SetRequest(req.getSource(),
196:                        NewprocessPackage.eINSTANCE
197:                                .getConclusion_ConclusionProxy(), req
198:                                .getTarget());
199:                return getMSLWrapper(new SetValueCommand(setReq));
200:            }
201:
202:            /**
203:             * @generated
204:             */
205:            protected Command getCreateCompleteIncomingExpansion_ExpansionProxy4006Command(
206:                    CreateRelationshipRequest req) {
207:                EObject sourceEObject = req.getSource();
208:                EObject targetEObject = req.getTarget();
209:                if (false == sourceEObject instanceof  Expansion
210:                        || false == targetEObject instanceof  ConditionProxy) {
211:                    return UnexecutableCommand.INSTANCE;
212:                }
213:                Expansion source = (Expansion) sourceEObject;
214:                ConditionProxy target = (ConditionProxy) targetEObject;
215:                if (!New_processBaseItemSemanticEditPolicy.LinkConstraints
216:                        .canCreateExpansionExpansionProxy_4006(source, target)) {
217:                    return UnexecutableCommand.INSTANCE;
218:                }
219:                SetRequest setReq = new SetRequest(req.getSource(),
220:                        NewprocessPackage.eINSTANCE
221:                                .getExpansion_ExpansionProxy(), req.getTarget());
222:                return getMSLWrapper(new SetValueCommand(setReq));
223:            }
224:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.