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


001:        package org.enhydra.jawe.base.panel.panels;
002:
003:        import java.awt.Component;
004:        import java.awt.Dimension;
005:        import java.awt.event.ActionEvent;
006:        import java.awt.event.ActionListener;
007:
008:        import javax.swing.Box;
009:        import javax.swing.JComboBox;
010:        import javax.swing.JScrollPane;
011:        import javax.swing.JViewport;
012:
013:        import org.enhydra.jawe.base.panel.PanelContainer;
014:        import org.enhydra.shark.xpdl.XMLAttribute;
015:        import org.enhydra.shark.xpdl.XMLElement;
016:
017:        /**
018:         * Creates a combo panel and a panel which type is determined by the
019:         * chosen element from combo panel.
020:         * @author Sasa Bojanic
021:         * @author Zoran Milakovic
022:         */
023:        public class XMLComboChoicePanel extends XMLBasicPanel {
024:
025:            protected XMLPanel prevPanel = null;
026:            protected XMLComboPanel pCombo;
027:            protected JScrollPane jsp;
028:
029:            public XMLComboChoicePanel(PanelContainer pc, XMLElement myOwnerL,
030:                    boolean isEnabled) {
031:                this (pc, myOwnerL, false, "", true, false, true, false,
032:                        isEnabled);
033:            }
034:
035:            public XMLComboChoicePanel(PanelContainer pc, XMLElement myOwner,
036:                    boolean addListener, String title, boolean isVertical,
037:                    boolean isChoiceVertical, boolean hasBorder,
038:                    boolean isEditable, boolean isEnabled) {
039:
040:                super (pc, myOwner, title, isVertical, hasBorder, true);
041:
042:                int noOfPanels = 2;
043:                if (myOwner instanceof  XMLAttribute) {
044:                    noOfPanels = 1;
045:                }
046:
047:                pCombo = new XMLComboPanel(pc, myOwner, null, false, false,
048:                        isChoiceVertical, isEditable, isEnabled);
049:                //System.err.println(pCombo.getSelectedItem().getClass().getName());
050:                XMLElement choosen = (XMLElement) pCombo.getSelectedItem();
051:                add(pCombo);
052:
053:                if (noOfPanels == 2) {
054:                    jsp = new JScrollPane();
055:                    jsp.setAlignmentX(Component.LEFT_ALIGNMENT);
056:                    jsp.setAlignmentY(Component.TOP_ALIGNMENT);
057:                    jsp.setMinimumSize(new Dimension(250, 200));
058:
059:                    add(jsp);
060:
061:                    prevPanel = pc.getPanelGenerator().getPanel(choosen);
062:                    jsp.setViewportView(prevPanel);
063:
064:                    final JComboBox jcb = pCombo.getComboBox();
065:                    jcb.addActionListener(new ActionListener() {
066:                        public void actionPerformed(ActionEvent ae) {
067:                            //               if (prevPanel!=null) {
068:                            //                  prevPanel.setElements();
069:                            //               }
070:                            XMLElement chosen = (XMLElement) pCombo
071:                                    .getSelectedItem();
072:                            if (chosen != null) {
073:                                prevPanel = getPanelContainer()
074:                                        .getPanelGenerator().getPanel(chosen);
075:                                jsp.setViewportView(prevPanel);
076:                            }
077:                        }
078:                    });
079:
080:                }
081:
082:                if (isVertical) {
083:                    add(Box.createVerticalGlue());
084:                } else {
085:                    add(Box.createHorizontalGlue());
086:                }
087:
088:            }
089:
090:            public XMLComboPanel getComboPanel() {
091:                return pCombo;
092:            }
093:
094:            public boolean validateEntry() {
095:                // checking Combo panel
096:                boolean isOK = pCombo.validateEntry();
097:                // checking implementation panel
098:                if (!(getOwner() instanceof  XMLAttribute)) {
099:                    JViewport jvp = (JViewport) jsp.getComponent(0);
100:                    if (jvp.getComponentCount() > 0) {
101:                        XMLPanel p = (XMLPanel) jvp.getComponent(0);
102:                        isOK = isOK && p.validateEntry();
103:                    }
104:                }
105:                return isOK;
106:            }
107:
108:            public void setElements() {
109:                if (!getOwner().isReadOnly()) {
110:                    // setting Combo panel
111:                    pCombo.setElements();
112:                    // setting implementation panel
113:                    if (!(myOwner instanceof  XMLAttribute)) {
114:                        JViewport jvp = jsp.getViewport();
115:                        if (jvp.getComponentCount() > 0) {
116:                            XMLPanel p = (XMLPanel) jvp.getComponent(0);
117:                            p.setElements();
118:                        }
119:                    }
120:                }
121:            }
122:
123:            public Object getValue() {
124:                return pCombo.getValue();
125:            }
126:
127:            public void cleanup() {
128:                pCombo.cleanup();
129:                if (!(myOwner instanceof  XMLAttribute)) {
130:                    JViewport jvp = jsp.getViewport();
131:                    if (jvp.getComponentCount() > 0) {
132:                        XMLPanel p = (XMLPanel) jvp.getComponent(0);
133:                        p.cleanup();
134:                    }
135:                }
136:            }
137:
138:            public void requestFocus() {
139:                pCombo.requestFocus();
140:            }
141:
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.