Source Code Cross Referenced for MessageUserObject.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.MessagePropertiesDialog;
029:        import com.metaboss.applications.designstudio.propertiesview.PropertiesTableModel;
030:        import com.metaboss.sdlctools.models.metabossmodel.MetaBossModelPackage;
031:        import com.metaboss.sdlctools.models.metabossmodel.ModelElement;
032:        import com.metaboss.sdlctools.models.metabossmodel.datadictionarymodel.DataDictionary;
033:        import com.metaboss.sdlctools.models.metabossmodel.datadictionarymodel.Namespace;
034:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EnterpriseModelPackage;
035:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Message;
036:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.MessageClass;
037:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.MessageType;
038:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.Servicemodule;
039:
040:        /*		BOMessage user object	 	*/
041:
042:        public class MessageUserObject extends BaseUserObject {
043:            public static final int ADD_FIELD = 1;
044:
045:            private Message mMessage = null;
046:            private AddNewFieldAction mAddNewFieldAction = new AddNewFieldAction();
047:            private StudyDependenciesAction mShowDataTypeDependenciesAction = new StudyDependenciesAction();
048:
049:            public MessageUserObject(Message pMessage) {
050:                super (pMessage, Application.MESSAGE_ICON);
051:                mMessage = pMessage;
052:            }
053:
054:            public MessageUserObject(Message pMessage, String pCaption,
055:                    int pMode) {
056:                super (pMessage, pCaption, pMode);
057:                mMessage = pMessage;
058:            }
059:
060:            // create new message
061:            public static void addNewMessage(Servicemodule pServiceModule)
062:                    throws Exception {
063:                new MessageUserObject(null).addNewObject(
064:                        getObjectPackage(pServiceModule), pServiceModule
065:                                .getMessages());
066:            }
067:
068:            // create new message
069:            public static void addNewMessage(Namespace pNamespace)
070:                    throws Exception {
071:                new MessageUserObject(null).addNewObject(
072:                        getObjectPackage(pNamespace), pNamespace.getMessages());
073:            }
074:
075:            // create new message
076:            public static void addNewMessage(DataDictionary pDataDictionary)
077:                    throws Exception {
078:                new MessageUserObject(null).addNewObject(
079:                        getObjectPackage(pDataDictionary), pDataDictionary
080:                                .getMessages());
081:            }
082:
083:            public BaseUserObject createNewObject(MetaBossModelPackage pPackage) {
084:                EnterpriseModelPackage lEnterpriseModelPackage = pPackage
085:                        .getEnterpriseModel();
086:                MessageClass lClass = lEnterpriseModelPackage.getMessage();
087:                return new MessageUserObject(lClass.createMessage());
088:            }
089:
090:            // return object root node captions
091:            public String getRootNodeName() {
092:                return Application.getString("messages_node");
093:            }
094:
095:            // convert tree element to an action code
096:            public int convertCaptionToAction(String pCaption) {
097:                if (pCaption.equals(Application.getString("fields_node")))
098:                    return ADD_FIELD;
099:                else
100:                    return super .convertCaptionToAction(pCaption);
101:            }
102:
103:            public Message getMessage() {
104:                return mMessage;
105:            }
106:
107:            // get object editor
108:            public BasePropertiesDialog getObjectEditor() {
109:                return new MessagePropertiesDialog();
110:            }
111:
112:            // add extra properties tabs
113:            public void addExtraPropertiesTabs(JTabbedPane pTabbedPane) {
114:                super .addExtraPropertiesTabs(pTabbedPane);
115:                pTabbedPane.insertTab("Fields", null, new FieldsViewPanel(
116:                        mMessage), null, 1);
117:            }
118:
119:            // load object properties into grid control
120:            public void loadObjectProperties(PropertiesTableModel pModel)
121:                    throws Exception {
122:                super .loadObjectProperties(pModel);
123:                if (pModel == null || mMessage == null)
124:                    return;
125:
126:                MessageType lMessageType = mMessage.getType();
127:                if (lMessageType != null)
128:                    pModel.AddProperty("Type", lMessageType.toString());
129:                pModel.AddProperty("Default Text", mMessage.getDefaultText());
130:            }
131:
132:            // fill actions list
133:            public void fillActionsList(ArrayList pList) {
134:                switch (mMode) {
135:                case ALL_ACTIONS:
136:                    super .fillActionsList(pList);
137:                    pList.add(new SeparatorAction());
138:                    pList.add(mAddNewFieldAction);
139:                    pList.add(new SeparatorAction());
140:                    pList.add(mShowDataTypeDependenciesAction);
141:                    break;
142:                case ADD_FIELD:
143:                    pList.add(mAddNewFieldAction);
144:                    break;
145:                }
146:            }
147:
148:            // add event
149:            public void addField() throws Exception {
150:                MessageFieldUserObject.addNewMessageField(mMessage);
151:            }
152:
153:            // can duplicate model element
154:            public boolean canDuplicate() {
155:                return true;
156:            }
157:
158:            // duplicate model element
159:            public ModelElement duplicate() throws Exception {
160:                Message lMessage = (Message) Application.sModelRepository
161:                        .duplicateModelElement(mMessage);
162:                lMessage.setServicemodule(mMessage.getServicemodule());
163:                lMessage.setNamespace(mMessage.getNamespace());
164:                return lMessage;
165:            }
166:
167:            /*				Actions				*/
168:
169:            public class AddNewFieldAction extends BaseAction {
170:                public AddNewFieldAction() {
171:                    super ("Add New Field", Application
172:                            .getAddIcon(Application.FIELDS_ICON));
173:                }
174:
175:                public void actionPerformed(ActionEvent e) {
176:                    try {
177:                        addField();
178:                    } catch (Throwable t) {
179:                        Application.processError(t);
180:                    }
181:                }
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.