Source Code Cross Referenced for RelationalAssociationTablePropertiesDialog.java in  » UML » MetaBoss » com » metaboss » applications » designstudio » propertiesdialogs » 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.propertiesdialogs 
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.propertiesdialogs;
016:
017:        import java.awt.Dimension;
018:
019:        import javax.swing.JComboBox;
020:        import javax.swing.JPanel;
021:        import javax.swing.JTextArea;
022:        import javax.swing.JTextField;
023:
024:        import com.metaboss.applications.designstudio.userobjects.AssociationItem;
025:        import com.metaboss.sdlctools.models.metabossmodel.ModelElement;
026:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.Association;
027:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.systemimplementationmodel.domainimplementationmodel.RelationalAssociationTable;
028:
029:        /*		RelationalAssociationTable user object		*/
030:
031:        public class RelationalAssociationTablePropertiesDialog extends
032:                ModelElementPropertiesDialog {
033:            private JPanel mOverridePanel = new JPanel();
034:            //properties
035:            private JComboBox mAssociationField = new JComboBox();
036:            private JTextField mTableAliasField = new JTextField();
037:            private JTextArea mDescriptionField = new JTextArea(8, 40);
038:            //override
039:            private JTextField mFirstRoleColumnNameOverrideField = new JTextField();
040:            private JTextField mFirstRoleReferentialConstraintNameOverrideField = new JTextField();
041:            private JTextField mNameOverrideField = new JTextField();
042:            private JTextField mPrimaryKeyConstraintNameOverrideField = new JTextField();
043:            private JTextField mSecondRoleColumnNameOverrideField = new JTextField();
044:            private JTextField mSecondRoleReferentialConstraintNameOverrideField = new JTextField();
045:
046:            public RelationalAssociationTablePropertiesDialog() {
047:                super ("Relational Association Table", new Dimension(400, 310));
048:
049:                mOverridePanel.setLayout(mClientGridBagLayout);
050:
051:                addTextField(mPropertiesPanel, "Name: ", mNameField, 1, true);
052:                addComboBox(mPropertiesPanel, "Association: ",
053:                        mAssociationField, 2, true);
054:                addTextField(mPropertiesPanel, "Table Alias: ",
055:                        mTableAliasField, 3, false);
056:                addTextArea(mPropertiesPanel, "Description: ",
057:                        mDescriptionField, 4, false);
058:
059:                addTextField(mOverridePanel, "First Role Column Name: ",
060:                        mFirstRoleColumnNameOverrideField, 3, false);
061:                addTextField(mOverridePanel,
062:                        "First Role Referential Constraint Name: ",
063:                        mFirstRoleReferentialConstraintNameOverrideField, 4,
064:                        false);
065:                addTextField(mOverridePanel, "Name: ", mNameOverrideField, 5,
066:                        false);
067:                addTextField(mOverridePanel, "Primary Key Constraint Name: ",
068:                        mPrimaryKeyConstraintNameOverrideField, 6, false);
069:                addTextField(mOverridePanel, "Second Role Column Name: ",
070:                        mSecondRoleColumnNameOverrideField, 7, false);
071:                addTextField(mOverridePanel,
072:                        "Second Role Referential Constraint Name: ",
073:                        mSecondRoleReferentialConstraintNameOverrideField, 8,
074:                        false);
075:
076:                mTabControl
077:                        .insertTab("Override", null, mOverridePanel, null, 1);
078:                mAssociationField
079:                        .addItemListener(new NameElementChangeListener());
080:            }
081:
082:            // load association table properties
083:            public void loadProperties(ModelElement pObject) throws Exception {
084:                if (pObject != null
085:                        && pObject instanceof  RelationalAssociationTable) {
086:                    RelationalAssociationTable lAssociationTable = (RelationalAssociationTable) pObject;
087:
088:                    AssociationItem.loadBoxWithAssociations(mAssociationField,
089:                            lAssociationTable.getDomainStorage().getDomain(),
090:                            false);
091:
092:                    mNameField.setText(lAssociationTable.getName());
093:                    mAssociationField.setSelectedIndex(AssociationItem
094:                            .findAssociationItemIndex(mAssociationField,
095:                                    lAssociationTable.getAssociation()));
096:                    mTableAliasField.setText(lAssociationTable.getTableAlias());
097:                    mFirstRoleColumnNameOverrideField.setText(lAssociationTable
098:                            .getFirstRoleColumnNameOverride());
099:                    mFirstRoleReferentialConstraintNameOverrideField
100:                            .setText(lAssociationTable
101:                                    .getFirstRoleReferentialConstraintNameOverride());
102:                    mNameOverrideField.setText(lAssociationTable
103:                            .getNameOverride());
104:                    mPrimaryKeyConstraintNameOverrideField
105:                            .setText(lAssociationTable
106:                                    .getPrimaryKeyConstraintNameOverride());
107:                    mSecondRoleColumnNameOverrideField
108:                            .setText(lAssociationTable
109:                                    .getSecondRoleColumnNameOverride());
110:                    mSecondRoleReferentialConstraintNameOverrideField
111:                            .setText(lAssociationTable
112:                                    .getSecondRoleReferentialConstraintNameOverride());
113:                    mDescriptionField.setText(lAssociationTable
114:                            .getDescription());
115:                }
116:                super .loadProperties(pObject);
117:            }
118:
119:            // save association table proeprties
120:            public void saveProperties(ModelElement pObject) throws Exception {
121:                super .saveProperties(pObject);
122:                if (pObject != null
123:                        && pObject instanceof  RelationalAssociationTable) {
124:                    RelationalAssociationTable lAssociationTable = (RelationalAssociationTable) pObject;
125:
126:                    lAssociationTable.setName(mNameField.getText());
127:                    lAssociationTable.setTableAlias(mTableAliasField.getText());
128:                    lAssociationTable
129:                            .setFirstRoleColumnNameOverride(mFirstRoleColumnNameOverrideField
130:                                    .getText());
131:                    lAssociationTable
132:                            .setFirstRoleReferentialConstraintNameOverride(mFirstRoleReferentialConstraintNameOverrideField
133:                                    .getText());
134:                    lAssociationTable.setNameOverride(mNameOverrideField
135:                            .getText());
136:                    lAssociationTable
137:                            .setPrimaryKeyConstraintNameOverride(mPrimaryKeyConstraintNameOverrideField
138:                                    .getText());
139:                    lAssociationTable
140:                            .setSecondRoleColumnNameOverride(mSecondRoleColumnNameOverrideField
141:                                    .getText());
142:                    lAssociationTable
143:                            .setSecondRoleReferentialConstraintNameOverride(mSecondRoleReferentialConstraintNameOverrideField
144:                                    .getText());
145:                    lAssociationTable.setDescription(mDescriptionField
146:                            .getText());
147:
148:                    AssociationItem lItem = (AssociationItem) mAssociationField
149:                            .getSelectedItem();
150:                    if (lItem != null)
151:                        lAssociationTable.setAssociation(lItem.mAssociation);
152:                    else
153:                        lAssociationTable.setAssociation(null);
154:                }
155:            }
156:
157:            protected ModelElement getNameElement() {
158:                Association lResult = null;
159:                try {
160:                    lResult = ((AssociationItem) mAssociationField
161:                            .getSelectedItem()).mAssociation;
162:                } catch (Exception e) {
163:                    lResult = null;
164:                }
165:                return lResult;
166:            }
167:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.