Source Code Cross Referenced for FeatureBrowser.java in  » Web-Framework » Millstone » org » millstone » examples » features » 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 » Web Framework » Millstone » org.millstone.examples.features 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* *************************************************************************
002:         
003:                                        Millstone(TM) 
004:                           Open Sourced User Interface Library for
005:                               Internet Development with Java
006:
007:                     Millstone is a registered trademark of IT Mill Ltd
008:                          Copyright (C) 2000-2005 IT Mill Ltd
009:                             
010:         *************************************************************************
011:
012:           This library is free software; you can redistribute it and/or
013:           modify it under the terms of the GNU Lesser General Public
014:           license version 2.1 as published by the Free Software Foundation.
015:
016:           This library is distributed in the hope that it will be useful,
017:           but WITHOUT ANY WARRANTY; without even the implied warranty of
018:           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
019:           Lesser General Public License for more details.
020:
021:           You should have received a copy of the GNU Lesser General Public
022:           License along with this library; if not, write to the Free Software
023:           Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
024:
025:         *************************************************************************
026:           
027:           For more information, contact:
028:           
029:           IT Mill Ltd                           phone: +358 2 4802 7180
030:           Ruukinkatu 2-4                        fax:  +358 2 4802 7181
031:           20540, Turku                          email: info@itmill.com
032:           Finland                               company www: www.itmill.com
033:           
034:           Primary source for MillStone information and releases: www.millstone.org
035:
036:         ********************************************************************** */
037:
038:        package org.millstone.examples.features;
039:
040:        import java.util.Iterator;
041:        import java.util.StringTokenizer;
042:
043:        import org.millstone.base.terminal.ClassResource;
044:        import org.millstone.base.ui.*;
045:        import org.millstone.base.data.*;
046:
047:        public class FeatureBrowser extends CustomComponent implements 
048:                Property.ValueChangeListener {
049:
050:            private Tree features;
051:            private Feature currentFeature = null;
052:            private GridLayout layout;
053:            private Component welcome;
054:            private boolean initialized = false;
055:
056:            private static final String WELCOME_TEXT = "<h3>Welcome to the Millstone feature tour!</h3>"
057:                    + "In this Millstone application you may view a demonstration of some of its "
058:                    + "features.<br/>"
059:                    + "Most of the features can be tested online and include simple example of their "
060:                    + "usage associated with it.<br/><br/>"
061:                    + "Start your tour by selecting features from the list on the left.<br/><br/>"
062:                    + "For more information, point your browser to: <a href=\"http://www.millstone.org\""
063:                    + " target=\"_new\">www.millstone.org</a>";
064:
065:            public void attach() {
066:
067:                if (initialized)
068:                    return;
069:                initialized = true;
070:
071:                // Configure tree
072:                features = new Tree();
073:                features.setStyle("menu");
074:                features.addContainerProperty("name", String.class, "");
075:                features.addContainerProperty("feature", Feature.class, null);
076:                features.setItemCaptionPropertyId("name");
077:                features.addListener(this );
078:                features.setImmediate(true);
079:
080:                // Configure component layout
081:                layout = new GridLayout(2, 1);
082:                setCompositionRoot(layout);
083:                OrderedLayout left = new OrderedLayout();
084:                left.addComponent(features);
085:                Button close = new Button("restart", getApplication(), "close");
086:                left.addComponent(close);
087:                close.setStyle("link");
088:                layout.addComponent(left, 0, 0, 0, 0);
089:                Label greeting = new Label(WELCOME_TEXT, Label.CONTENT_XHTML);
090:                //welcomePanel = new Panel((String) null);
091:                welcome = new Embedded("", new ClassResource(getClass(),
092:                        "millstone-logo.gif", getApplication()));
093:                //  welcomePanel.addComponent(greeting);
094:                layout.addComponent(welcome, 1, 0, 1, 0);
095:
096:                // Test component
097:                registerFeature("/UI Components", new UIComponents());
098:                registerFeature("/UI Components/Basic/Text Field",
099:                        new FeatureTextField());
100:                registerFeature("/UI Components/Basic/Date Field",
101:                        new FeatureDateField());
102:                registerFeature("/UI Components/Basic/Button",
103:                        new FeatureButton());
104:                registerFeature("/UI Components/Basic/Form", new FeatureForm());
105:                registerFeature("/UI Components/Basic/Label",
106:                        new FeatureLabel());
107:                registerFeature("/UI Components/Basic/Link", new FeatureLink());
108:                registerFeature("/UI Components/Item Containers/Select",
109:                        new FeatureSelect());
110:                registerFeature("/UI Components/Item Containers/Table",
111:                        new FeatureTable());
112:                registerFeature("/UI Components/Item Containers/Tree",
113:                        new FeatureTree());
114:                registerFeature("/UI Components/Layouts/Ordered Layout",
115:                        new FeatureOrderedLayout());
116:                registerFeature("/UI Components/Layouts/Grid Layout",
117:                        new FeatureGridLayout());
118:                registerFeature("/UI Components/Layouts/Custom Layout",
119:                        new FeatureCustomLayout());
120:                registerFeature("/UI Components/Layouts/Panel",
121:                        new FeaturePanel());
122:                registerFeature("/UI Components/Layouts/Tab Sheet",
123:                        new FeatureTabSheet());
124:                registerFeature("/UI Components/Layouts/Window",
125:                        new FeatureWindow());
126:                registerFeature("/UI Components/Layouts/Frame Window",
127:                        new FeatureFrameWindow());
128:                registerFeature(
129:                        "/UI Components/Data handling/Embedded Objects",
130:                        new FeatureEmbedded());
131:                registerFeature("/UI Components/Data handling/Upload",
132:                        new FeatureUpload());
133:                registerFeature("/Data Model/Properties",
134:                        new FeatureProperties());
135:                registerFeature("/Data Model/Items", new FeatureItems());
136:                registerFeature("/Data Model/Containers",
137:                        new FeatureContainers());
138:                registerFeature("/Data Model/Validators",
139:                        new FeatureValidators());
140:                registerFeature("/Data Model/Buffering", new FeatureBuffering());
141:                registerFeature("/Terminal/Server Initiated Events",
142:                        new FeatureServerEvents());
143:                registerFeature("/Terminal/Parameters and URI Handling",
144:                        new FeatureParameters());
145:
146:                // Pre-open all menus
147:                for (Iterator i = features.getItemIds().iterator(); i.hasNext();)
148:                    features.expandItem(i.next());
149:            }
150:
151:            public void registerFeature(String path, Feature feature) {
152:                StringTokenizer st = new StringTokenizer(path, "/");
153:                String id = "";
154:                String parentId = null;
155:                while (st.hasMoreTokens()) {
156:                    String token = st.nextToken();
157:                    id += "/" + token;
158:                    if (!features.containsId(id)) {
159:                        features.addItem(id);
160:                        features.setChildrenAllowed(id, false);
161:                    }
162:                    features.getContainerProperty(id, "name").setValue(token);
163:                    if (parentId != null) {
164:                        features.setChildrenAllowed(parentId, true);
165:                        features.setParent(id, parentId);
166:                    }
167:                    if (!st.hasMoreTokens())
168:                        features.getContainerProperty(id, "feature").setValue(
169:                                feature);
170:                    parentId = id;
171:                }
172:            }
173:
174:            public void valueChange(Property.ValueChangeEvent event) {
175:
176:                // Change feature
177:                if (event.getProperty() == features) {
178:                    Object id = features.getValue();
179:                    if (id != null) {
180:                        if (features.areChildrenAllowed(id))
181:                            features.expandItem(id);
182:                        Property p = features.getContainerProperty(id,
183:                                "feature");
184:                        Feature feature = p != null ? ((Feature) p.getValue())
185:                                : null;
186:                        if (feature != null) {
187:                            if (currentFeature != null)
188:                                layout.removeComponent(currentFeature);
189:                            currentFeature = feature;
190:                            layout.removeComponent(1, 0);
191:                            layout.addComponent(currentFeature, 1, 0);
192:                            getWindow().setCaption(
193:                                    "Millstone Features / "
194:                                            + features.getContainerProperty(id,
195:                                                    "name"));
196:                        }
197:                    }
198:                }
199:            }
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.