Source Code Cross Referenced for EventSubscriptionOperationPropertiesDialog.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.BorderLayout;
018:        import java.awt.Dimension;
019:        import java.awt.event.ActionEvent;
020:
021:        import javax.swing.JPanel;
022:        import javax.swing.JScrollPane;
023:        import javax.swing.JTextArea;
024:        import javax.swing.JToolBar;
025:        import javax.swing.ListSelectionModel;
026:        import javax.swing.border.Border;
027:        import javax.swing.event.ListSelectionEvent;
028:        import javax.swing.event.ListSelectionListener;
029:
030:        import com.metaboss.applications.designstudio.Application;
031:        import com.metaboss.applications.designstudio.BaseAction;
032:        import com.metaboss.applications.designstudio.components.FieldsTable;
033:        import com.metaboss.applications.designstudio.constraintstable.ConstraintsTableModel;
034:        import com.metaboss.applications.designstudio.fieldstable.FieldsEditPanel;
035:        import com.metaboss.applications.designstudio.userobjects.ModelElementConstraintUserObject;
036:        import com.metaboss.sdlctools.models.metabossmodel.ModelElement;
037:        import com.metaboss.sdlctools.models.metabossmodel.enterprisemodel.EventSubscriptionOperation;
038:
039:        /*    EventSubscriptionOperation properties dialog      */
040:
041:        public class EventSubscriptionOperationPropertiesDialog extends
042:                ModelElementPropertiesDialog {
043:            private EventSubscriptionOperation mOperation = null;
044:            // UI constrols
045:            private FieldsEditPanel mInputFieldsPanel = new FieldsEditPanel(1);
046:            private FieldsEditPanel mOutputFieldsPanel = new FieldsEditPanel(2);
047:            private FieldsEditPanel mOutputMessagesPanel = new FieldsEditPanel(
048:                    3);
049:            private JPanel mConstraintsPanel = new JPanel();
050:            // properties
051:            private JTextArea mDescriptionField = new JTextArea(8, 40);
052:            //constraints
053:            private ConstraintsTableModel mConstraintsTableModel = new ConstraintsTableModel();
054:            private FieldsTable mConstraintsTable = new FieldsTable(
055:                    mConstraintsTableModel);
056:            private JToolBar mConstraintsToolBar = new JToolBar();
057:            //actions
058:            private AddConstraintAction mAddConstraintAction = new AddConstraintAction();
059:            private EditConstraintAction mEditConstraintAction = new EditConstraintAction();
060:            private DeleteConstraintAction mDeleteConstraintAction = new DeleteConstraintAction();
061:
062:            public EventSubscriptionOperationPropertiesDialog() {
063:                super ("Event Subscription Operation", new Dimension(450, 320));
064:
065:                mConstraintsPanel.setLayout(new BorderLayout());
066:
067:                addTextField(mPropertiesPanel, "Name: ", mNameField, 1, true);
068:                addTextArea(mPropertiesPanel, "Description: ",
069:                        mDescriptionField, 2, false);
070:                //constraints
071:                mConstraintsPanel.add(new JScrollPane(mConstraintsTable),
072:                        BorderLayout.CENTER);
073:                mConstraintsPanel.add(mConstraintsToolBar, BorderLayout.SOUTH);
074:
075:                mConstraintsTable.setCellSelectionEnabled(true);
076:                mConstraintsTable.setRowSelectionAllowed(true);
077:                mConstraintsTable.setColumnSelectionAllowed(false);
078:                mConstraintsTable
079:                        .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
080:
081:                mConstraintsToolBar.setBorder(null);
082:                mConstraintsToolBar.add(Application
083:                        .createButton(mAddConstraintAction));
084:                mConstraintsToolBar.add(Application
085:                        .createButton(mEditConstraintAction));
086:                mConstraintsToolBar.add(Application
087:                        .createButton(mDeleteConstraintAction));
088:
089:                Border lBorder = createEditorBorder();
090:                mConstraintsPanel.setBorder(lBorder);
091:
092:                mTabControl.insertTab("Input Fields", null, mInputFieldsPanel,
093:                        null, 1);
094:                mTabControl.insertTab("Input Constraints", null,
095:                        mConstraintsPanel, null, 2);
096:                mTabControl.insertTab("Output Fields", null,
097:                        mOutputFieldsPanel, null, 3);
098:                mTabControl.insertTab("Output Messages", null,
099:                        mOutputMessagesPanel, null, 4);
100:            }
101:
102:            // load service module properties
103:            public void loadProperties(ModelElement pObject) throws Exception {
104:                mOperation = null;
105:                if (pObject != null
106:                        && pObject instanceof  EventSubscriptionOperation) {
107:                    mOperation = (EventSubscriptionOperation) pObject;
108:
109:                    mNameField.setText(mOperation.getName());
110:                    mDescriptionField.setText(mOperation.getDescription());
111:
112:                    mInputFieldsPanel.loadFields(mOperation);
113:                    mOutputFieldsPanel.loadFields(mOperation);
114:                    mOutputMessagesPanel.loadFields(mOperation);
115:                    mConstraintsTableModel.loadConstraints(mOperation,
116:                            mOperation.getInputConstraints().toArray());
117:                }
118:
119:                checkActions();
120:                mConstraintsTable.getSelectionModel().addListSelectionListener(
121:                        new ListSelectionListener() {
122:                            public void valueChanged(ListSelectionEvent e) {
123:                                checkActions();
124:                            }
125:                        });
126:
127:                super .loadProperties(pObject);
128:            }
129:
130:            // save service module proeprties
131:            public void saveProperties(ModelElement pObject) throws Exception {
132:                super .saveProperties(pObject);
133:                if (pObject != null
134:                        && pObject instanceof  EventSubscriptionOperation) {
135:                    EventSubscriptionOperation lOperation = (EventSubscriptionOperation) pObject;
136:                    lOperation.setName(mNameField.getText());
137:                    lOperation.setDescription(mDescriptionField.getText());
138:                }
139:            }
140:
141:            // check fields data
142:            public boolean checkProperties() {
143:                if (mNameField.getText().length() == 0) {
144:                    Application.showError("Name field could not be blank!");
145:                    return false;
146:                }
147:                return super .checkProperties();
148:            }
149:
150:            // add attribute
151:            private void addConstraint() {
152:                if (mOperation != null) {
153:                    try {
154:                        ModelElementConstraintUserObject
155:                                .addNewConstraint(mOperation);
156:                    } catch (Exception e) {
157:                        Application.processError(e);
158:                    }
159:                }
160:            }
161:
162:            // edit current attribute   
163:            private void editConstraint() {
164:                ModelElementConstraintUserObject lConstraint = mConstraintsTableModel
165:                        .getConstraint(mConstraintsTable.getSelectedRow());
166:                if (lConstraint != null)
167:                    lConstraint.getEditAction().run();
168:            }
169:
170:            // delete Attribute
171:            private void deleteConstraint() {
172:                ModelElementConstraintUserObject lConstraint = mConstraintsTableModel
173:                        .getConstraint(mConstraintsTable.getSelectedRow());
174:                if (lConstraint != null)
175:                    lConstraint.getDeleteAction().run();
176:            }
177:
178:            // check edit actins
179:            private void checkActions() {
180:                boolean lConstraintEditOk = mConstraintsTable != null
181:                        && mConstraintsTable.getSelectedRow() > -1;
182:
183:                mAddConstraintAction.setEnabled(true);
184:                mEditConstraintAction.setEnabled(lConstraintEditOk);
185:                mDeleteConstraintAction.setEnabled(lConstraintEditOk);
186:            }
187:
188:            /*      Actions         */
189:
190:            public class AddConstraintAction extends BaseAction {
191:                public AddConstraintAction() {
192:                    super ("Add New Constraint", Application.ADDNEW_ICON);
193:                }
194:
195:                public void actionPerformed(ActionEvent arg0) {
196:                    addConstraint();
197:                }
198:            }
199:
200:            public class EditConstraintAction extends BaseAction {
201:                public EditConstraintAction() {
202:                    super ("Edit Constraint", Application.EDIT_ICON);
203:                }
204:
205:                public void actionPerformed(ActionEvent arg0) {
206:                    editConstraint();
207:                }
208:            }
209:
210:            public class DeleteConstraintAction extends BaseAction {
211:                public DeleteConstraintAction() {
212:                    super ("Delete Constraint", Application.DELETE_ICON);
213:                }
214:
215:                public void actionPerformed(ActionEvent arg0) {
216:                    deleteConstraint();
217:                }
218:            }
219:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.