Source Code Cross Referenced for ValidationOrSearchResultEditor.java in  » Workflow-Engines » JaWE » org » enhydra » jawe » base » editor » 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 » JaWE » org.enhydra.jawe.base.editor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.enhydra.jawe.base.editor;
002:
003:        import java.awt.Container;
004:        import java.awt.event.ActionEvent;
005:        import java.awt.event.ActionListener;
006:        import java.awt.event.KeyEvent;
007:        import java.awt.event.WindowAdapter;
008:        import java.awt.event.WindowEvent;
009:        import java.awt.event.WindowListener;
010:        import java.util.List;
011:        import java.util.Observable;
012:        import java.util.Observer;
013:        import java.util.Properties;
014:
015:        import javax.swing.AbstractAction;
016:        import javax.swing.Action;
017:        import javax.swing.BoxLayout;
018:        import javax.swing.JComponent;
019:        import javax.swing.JDialog;
020:        import javax.swing.KeyStroke;
021:        import javax.swing.WindowConstants;
022:
023:        import org.enhydra.jawe.JaWEComponent;
024:        import org.enhydra.jawe.JaWEComponentSettings;
025:        import org.enhydra.jawe.JaWEComponentView;
026:        import org.enhydra.jawe.JaWEManager;
027:        import org.enhydra.jawe.ResourceManager;
028:        import org.enhydra.jawe.XPDLElementChangeInfo;
029:        import org.enhydra.jawe.base.panel.InlinePanel;
030:        import org.enhydra.jawe.base.panel.panels.ValidationErrorOrSearchResultListPanel;
031:        import org.enhydra.jawe.base.panel.panels.XMLBasicPanel;
032:        import org.enhydra.jawe.base.panel.panels.XMLPanel;
033:        import org.enhydra.shark.xpdl.XMLCollection;
034:        import org.enhydra.shark.xpdl.XMLElement;
035:        import org.enhydra.shark.xpdl.elements.Package;
036:
037:        /**
038:         *  
039:         */
040:        public class ValidationOrSearchResultEditor extends JDialog implements 
041:                JaWEComponent, Observer {
042:
043:            protected String type = JaWEComponent.OTHER_COMPONENT;
044:
045:            protected Properties properties = new Properties();
046:
047:            protected XMLPanel panelToEdit = new XMLBasicPanel();
048:
049:            protected boolean validationDisplayEnabled = true;
050:
051:            protected boolean searchDisplayEnabled = true;
052:
053:            public String getLanguageDependentString(String nm) {
054:                return ResourceManager.getLanguageDependentString(nm);
055:            }
056:
057:            public ValidationOrSearchResultEditor() {
058:                super (JaWEManager.getInstance().getJaWEController()
059:                        .getJaWEFrame(), false);
060:                init();
061:            }
062:
063:            public JaWEComponentSettings getSettings() {
064:                return null;
065:            }
066:
067:            public Properties getProperties() {
068:                return properties;
069:            }
070:
071:            public void setValidationDisplayEnabled(boolean enabled) {
072:                this .validationDisplayEnabled = enabled;
073:            }
074:
075:            public void setSearchDisplayEnabled(boolean enabled) {
076:                this .searchDisplayEnabled = enabled;
077:            }
078:
079:            public void update(Observable o, Object arg) {
080:                if (!(arg instanceof  XPDLElementChangeInfo))
081:                    return;
082:
083:                XPDLElementChangeInfo info = (XPDLElementChangeInfo) arg;
084:                if (info.getChangedElement() == null)
085:                    return;
086:                int action = info.getAction();
087:
088:                if (!((action == XPDLElementChangeInfo.VALIDATION_ERRORS
089:                        && validationDisplayEnabled && (info.getOldValue() instanceof  Boolean && !((Boolean) info
090:                        .getOldValue()).booleanValue())) || ((action == XPDLElementChangeInfo.SEARCH_RESULT) || action == XPDLElementChangeInfo.REFERENCES)
091:                        && searchDisplayEnabled))
092:                    return;
093:
094:                String t = "";
095:                if (action == XPDLElementChangeInfo.VALIDATION_ERRORS) {
096:                    t = getLanguageDependentString("DialogValidationReport");
097:                } else {
098:                    t = getLanguageDependentString("DialogSearchResult");
099:                }
100:                setTitle(t);
101:                setDisplayPanel(t, info.getChangedElement(), info
102:                        .getChangedSubElements());
103:            }
104:
105:            public JaWEComponentView getView() {
106:                return null;
107:            }
108:
109:            public JComponent getDisplay() {
110:                return null;
111:            }
112:
113:            public String getType() {
114:                return type;
115:            }
116:
117:            public void setType(String type) {
118:                this .type = type;
119:            }
120:
121:            public String getName() {
122:                return "VALIDATION_EDITOR";
123:            }
124:
125:            public boolean adjustXPDL(Package pkg) {
126:                return false;
127:            }
128:
129:            public List checkValidity(XMLElement el, boolean fullCheck) {
130:                return null;
131:            }
132:
133:            public boolean canCreateElement(XMLCollection col) {
134:                return true;
135:            }
136:
137:            public boolean canInsertElement(XMLCollection col, XMLElement el) {
138:                return true;
139:            }
140:
141:            public boolean canModifyElement(XMLCollection col, XMLElement el) {
142:                return true;
143:            }
144:
145:            public boolean canModifyElement(XMLElement col) {
146:                return true;
147:            }
148:
149:            public boolean canRemoveElement(XMLCollection col, XMLElement el) {
150:                return true;
151:            }
152:
153:            public boolean canDuplicateElement(XMLCollection col, XMLElement el) {
154:                return true;
155:            }
156:
157:            public boolean canRepositionElement(XMLCollection col, XMLElement el) {
158:                return true;
159:            }
160:
161:            public Action getAction(String cmd) {
162:                return null;
163:            }
164:
165:            public Action[] getActions() {
166:                return null;
167:            }
168:
169:            public void configure(Properties props) {
170:                this .properties = props;
171:            }
172:
173:            protected void init() {
174:                try {
175:                    JaWEManager.getInstance().getJaWEController().addObserver(
176:                            this );
177:
178:                    initDialog();
179:
180:                } catch (Exception e) {
181:                    e.printStackTrace();
182:                }
183:            }
184:
185:            protected void initDialog() {
186:                try {
187:
188:                    Container cp = getContentPane();
189:                    cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
190:
191:                    cp.add(panelToEdit);
192:                    getRootPane()
193:                            .getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
194:                            .put(
195:                                    KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,
196:                                            0, false), "Cancel");
197:                    getRootPane().getInputMap(JComponent.WHEN_FOCUSED)
198:                            .put(
199:                                    KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,
200:                                            0, false), "Cancel");
201:                    getRootPane().getActionMap().put("Cancel",
202:                            new AbstractAction() {
203:                                public void actionPerformed(ActionEvent e) {
204:                                    cl.actionPerformed(e);
205:                                }
206:                            });
207:                    addWindowListener(wl);
208:
209:                } catch (Exception e) {
210:                    e.printStackTrace();
211:                }
212:                setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
213:                setResizable(true);
214:
215:            }
216:
217:            protected WindowListener wl = new WindowAdapter() {
218:                public void windowClosing(WindowEvent e) {
219:                    close();
220:                }
221:            };
222:
223:            protected ActionListener cl = new ActionListener() {
224:                public void actionPerformed(ActionEvent ae) {
225:                    close();
226:                }
227:            };
228:
229:            public InlinePanel getInlinePanel() {
230:                return null;
231:            }
232:
233:            public void close() {
234:                setVisible(false);
235:                panelToEdit.cleanup();
236:                Container cp = getContentPane();
237:                cp.remove(panelToEdit);
238:                panelToEdit = new XMLBasicPanel();
239:                cp.add(panelToEdit, 0);
240:            }
241:
242:            public void setDisplayPanel(String t, XMLElement el, List errors) {
243:                setModal(true);
244:                showPanel(new ValidationErrorOrSearchResultListPanel(el,
245:                        errors, t, true, true));
246:            }
247:
248:            public void showPanel(XMLPanel newPanel) {
249:                Container cp = getContentPane();
250:                cp.remove(panelToEdit);
251:                panelToEdit = newPanel;
252:                cp.add(panelToEdit, 0);
253:                pack();
254:
255:                panelToEdit.requestFocus();
256:                pack();
257:
258:                if (!isVisible()) {
259:                    setLocationRelativeTo(JaWEManager.getInstance()
260:                            .getJaWEController().getJaWEFrame());
261:                    setVisible(true);
262:                }
263:            }
264:
265:            public void setUpdateInProgress(boolean inProgress) {
266:            }
267:
268:            public boolean isUpdateInProgress() {
269:                return false;
270:            }
271:
272:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.