Source Code Cross Referenced for Checkout.java in  » XML-UI » xui32 » com » xoetrope » carousel » catalog » templates » javaclasses » 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 » XML UI » xui32 » com.xoetrope.carousel.catalog.templates.javaclasses 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.xoetrope.carousel.catalog.templates.javaclasses;
002:
003:        import net.xoetrope.xui.XPage;
004:        import net.xoetrope.swing.XDialog; //BEGIN_BLOCK_IMPORTS
005:        import com.xoetrope.carousel.build.BuildProperties;
006:        import net.xoetrope.swing.XLabel;
007:        import net.xoetrope.swing.XTextArea;
008:        import net.xoetrope.xui.data.XBaseModel;
009:        import net.xoetrope.xui.data.XModel;
010:
011:        //END_BLOCK_IMPORTS
012:
013:        public class Checkout extends XPage {
014:            //BEGIN_BLOCK_VARS
015:            protected XTextArea tabArea, descriptionArea;
016:            protected XLabel totalPrice;
017:
018:            //END_BLOCK_VARS
019:
020:            public Checkout() {
021:            }
022:
023:            public void pageActivated() {
024:                //BEGIN_BLOCK_VARS
025:                descriptionArea = (XTextArea) findComponent("descriptionArea");
026:                tabArea = (XTextArea) findComponent("tabLabel");
027:                tabArea.setText("Product\t\t\t" + "Quantity\t\t\t"
028:                        + "Price\n\n");
029:                totalPrice = (XLabel) findComponent("totalPrice");
030:
031:                XModel cart = (XModel) rootModel.get("productsCart");
032:                double total = 0;
033:
034:                descriptionArea.setText("");
035:
036:                if (cart.getNumChildren() > 1) {
037:                    for (int i = 1; i < cart.getNumChildren(); i++) {
038:                        XBaseModel header = (XBaseModel) cart.get(i);
039:
040:                        XBaseModel title = (XBaseModel) header.get(0);
041:                        XBaseModel qty = (XBaseModel) header.get(1);
042:                        XBaseModel price = (XBaseModel) header.get(2);
043:
044:                        String info = null;
045:                        if (((String) title.getAttribValue(0)).length() > 25) {
046:                            info = title.getAttribValue(0) + "\t      "
047:                                    + qty.getAttribValue(0) + "\t\t\t"
048:                                    + price.getAttribValue(0) + "\n";
049:                        } else if (((String) title.getAttribValue(0)).length() > 10) {
050:                            info = title.getAttribValue(0) + "\t\t      "
051:                                    + qty.getAttribValue(0) + "\t\t\t"
052:                                    + price.getAttribValue(0) + "\n";
053:                        } else {
054:                            info = title.getAttribValue(0) + "\t\t\t      "
055:                                    + qty.getAttribValue(0) + "\t\t\t"
056:                                    + price.getAttribValue(0) + "\n";
057:                        }
058:                        //BEGIN_BLOCK_PRICES
059:                        String p = ((String) price.getAttribValue(0))
060:                                .substring(1);
061:                        total = total + Double.parseDouble(p);
062:                        //END_BLOCK_PRICES
063:                        descriptionArea.setText(descriptionArea.getText()
064:                                + info);
065:                    }
066:                    //BEGIN_BLOCK_PRICES
067:                    String result = "$" + Double.toString(total);
068:                    result = result.substring(0, result.indexOf(".") + 3);
069:                    totalPrice.setText(result);
070:                    //END_BLOCK_PRICES
071:                }
072:                //END_BLOCK_VARS
073:            }
074:
075:            //BEGIN_BLOCK_PREVIOUS
076:            public void openCatalog() {
077:                pageMgr.showPage("Products");
078:            }
079:
080:            //END_BLOCK_PREVIOUS  
081:            //BEGIN_BLOCK_HOME
082:            public void openWelcome() {
083:                pageMgr.showPage("Welcome");
084:            }
085:
086:            //END_BLOCK_HOME  
087:            //BEGIN_BLOCK_ABOUT
088:            public void openAbout() {
089:                XDialog dlg = (XDialog) pageMgr.loadPage("About");
090:                dlg.pack();
091:                dlg.showDialog(this );
092:            }
093:
094:            //END_BLOCK_ABOUT    
095:            //BEGIN_BLOCK_CLOSE
096:            public void submitOrder() {
097:                XDialog dlg = (XDialog) pageMgr.loadPage("Submit");
098:                dlg.pack();
099:                dlg.showDialog(this );
100:                //BEGIN_BLOCK_VARS
101:                descriptionArea.setText("");
102:                //END_BLOCK_VARS
103:            }
104:
105:            //END_BLOCK_CLOSE
106:            public void closeCatalog() {
107:                System.exit(0);
108:            }
109:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.