Source Code Cross Referenced for AutomaticComponentBuildTreeNode.java in  » Ajax » ItsNat » org » itsnat » feashow » features » components » 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 » Ajax » ItsNat » org.itsnat.feashow.features.components 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is not part of the ItsNat framework.
003:         *
004:         * Original source code use and closed source derivatives are authorized
005:         * to third parties with no restriction or fee.
006:         * The original source code is owned by the author.
007:         *
008:         * This program is distributed AS IS in the hope that it will be useful,
009:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
011:         *
012:         * Author: Jose Maria Arranz Santamaria
013:         * (C) Innowhere Software Services S.L., Spanish company, year 2007
014:         */
015:
016:        package org.itsnat.feashow.features.components;
017:
018:        import javax.swing.DefaultListModel;
019:        import javax.swing.MutableComboBoxModel;
020:        import javax.swing.table.DefaultTableModel;
021:        import javax.swing.tree.DefaultMutableTreeNode;
022:        import javax.swing.tree.DefaultTreeModel;
023:        import org.itsnat.comp.ItsNatComponent;
024:        import org.itsnat.comp.ItsNatComponentManager;
025:        import org.itsnat.comp.free.ItsNatFreeButtonNormal;
026:        import org.itsnat.comp.free.ItsNatFreeCheckBox;
027:        import org.itsnat.comp.free.ItsNatFreeComboBox;
028:        import org.itsnat.comp.free.ItsNatFreeInclude;
029:        import org.itsnat.comp.free.ItsNatFreeLabel;
030:        import org.itsnat.comp.free.ItsNatFreeRadioButton;
031:        import org.itsnat.comp.free.ItsNatFreeTable;
032:        import org.itsnat.comp.free.ItsNatFreeTree;
033:        import org.itsnat.comp.ItsNatLabel;
034:        import org.itsnat.comp.free.ItsNatFreeButtonNormalLabel;
035:        import org.itsnat.comp.free.ItsNatFreeCheckBoxLabel;
036:        import org.itsnat.comp.free.ItsNatFreeListMultSel;
037:        import org.itsnat.comp.free.ItsNatFreeRadioButtonLabel;
038:        import org.itsnat.comp.html.ItsNatHTMLAnchor;
039:        import org.itsnat.comp.html.ItsNatHTMLAnchorLabel;
040:        import org.itsnat.comp.html.ItsNatHTMLButton;
041:        import org.itsnat.comp.html.ItsNatHTMLButtonLabel;
042:        import org.itsnat.comp.html.ItsNatHTMLForm;
043:        import org.itsnat.comp.html.ItsNatHTMLInputButton;
044:        import org.itsnat.comp.html.ItsNatHTMLInputCheckBox;
045:        import org.itsnat.comp.html.ItsNatHTMLInputFile;
046:        import org.itsnat.comp.html.ItsNatHTMLInputHidden;
047:        import org.itsnat.comp.html.ItsNatHTMLInputImage;
048:        import org.itsnat.comp.html.ItsNatHTMLInputPassword;
049:        import org.itsnat.comp.html.ItsNatHTMLInputRadio;
050:        import org.itsnat.comp.html.ItsNatHTMLInputReset;
051:        import org.itsnat.comp.html.ItsNatHTMLInputSubmit;
052:        import org.itsnat.comp.html.ItsNatHTMLInputText;
053:        import org.itsnat.comp.html.ItsNatHTMLInputTextFormatted;
054:        import org.itsnat.comp.html.ItsNatHTMLSelectComboBox;
055:        import org.itsnat.comp.html.ItsNatHTMLSelectMult;
056:        import org.itsnat.comp.html.ItsNatHTMLTable;
057:        import org.itsnat.comp.html.ItsNatHTMLTextArea;
058:        import org.itsnat.core.ItsNatDocument;
059:        import org.itsnat.feashow.FeatureTreeNode;
060:        import org.itsnat.feashow.features.components.custom.LoginComponent;
061:        import org.itsnat.feashow.features.components.lists.CityListCustomStructure;
062:        import org.w3c.dom.Element;
063:
064:        public class AutomaticComponentBuildTreeNode extends FeatureTreeNode {
065:            protected Element parentElem;
066:
067:            public AutomaticComponentBuildTreeNode() {
068:            }
069:
070:            public void startExamplePanel() {
071:                ItsNatDocument itsNatDoc = getItsNatDocument();
072:                ItsNatComponentManager componentMgr = itsNatDoc
073:                        .getItsNatComponentManager();
074:
075:                this .parentElem = itsNatDoc.getDocument().getElementById(
076:                        "compGroupId");
077:                componentMgr.buildItsNatComponents(parentElem);
078:
079:                // Normal Buttons
080:
081:                ItsNatHTMLInputButton inputButton = (ItsNatHTMLInputButton) componentMgr
082:                        .findItsNatComponentById("inputButtonId");
083:                check(inputButton);
084:                inputButton.setLabelValue("Input Button");
085:
086:                ItsNatHTMLInputImage inputImage = (ItsNatHTMLInputImage) componentMgr
087:                        .findItsNatComponentById("inputImageId");
088:                check(inputImage);
089:
090:                ItsNatHTMLInputSubmit inputSubmit = (ItsNatHTMLInputSubmit) componentMgr
091:                        .findItsNatComponentById("inputSubmitId");
092:                check(inputSubmit);
093:                inputSubmit.setLabelValue("Input Submit");
094:
095:                ItsNatHTMLInputReset inputReset = (ItsNatHTMLInputReset) componentMgr
096:                        .findItsNatComponentById("inputResetId");
097:                check(inputReset);
098:                inputReset.setLabelValue("Input Reset");
099:
100:                ItsNatHTMLButton button = (ItsNatHTMLButton) componentMgr
101:                        .findItsNatComponentById("buttonId");
102:                check(button);
103:
104:                ItsNatHTMLButtonLabel buttonLabel = (ItsNatHTMLButtonLabel) componentMgr
105:                        .findItsNatComponentById("buttonLabelId");
106:                check(buttonLabel);
107:                buttonLabel.setLabelValue("Button With Label");
108:
109:                ItsNatHTMLAnchor anchor = (ItsNatHTMLAnchor) componentMgr
110:                        .findItsNatComponentById("anchorId");
111:                check(anchor);
112:
113:                ItsNatHTMLAnchorLabel anchorLabel = (ItsNatHTMLAnchorLabel) componentMgr
114:                        .findItsNatComponentById("anchorLabelId");
115:                check(anchorLabel);
116:                buttonLabel.setLabelValue("Anchor With Label");
117:
118:                ItsNatFreeButtonNormal freeButtonNormal = (ItsNatFreeButtonNormal) componentMgr
119:                        .findItsNatComponentById("freeButtonNormalId");
120:                check(freeButtonNormal);
121:
122:                ItsNatFreeButtonNormalLabel freeButtonNormalLabel = (ItsNatFreeButtonNormalLabel) componentMgr
123:                        .findItsNatComponentById("freeButtonNormalLabelId");
124:                check(freeButtonNormalLabel);
125:                freeButtonNormalLabel.setLabelValue("Free Button Normal Label");
126:
127:                // Toggle Buttons
128:
129:                ItsNatHTMLInputCheckBox inputCheckBox = (ItsNatHTMLInputCheckBox) componentMgr
130:                        .findItsNatComponentById("inputCheckBoxId");
131:                check(inputCheckBox);
132:
133:                ItsNatHTMLInputRadio inputRadio = (ItsNatHTMLInputRadio) componentMgr
134:                        .findItsNatComponentById("inputRadioButtonId");
135:                check(inputRadio);
136:
137:                ItsNatFreeCheckBox freeCheckBox = (ItsNatFreeCheckBox) componentMgr
138:                        .findItsNatComponentById("freeCheckBoxId");
139:                check(freeCheckBox);
140:
141:                ItsNatFreeCheckBoxLabel freeCheckBoxLabel = (ItsNatFreeCheckBoxLabel) componentMgr
142:                        .findItsNatComponentById("freeCheckBoxLabelId");
143:                check(freeCheckBoxLabel);
144:                freeCheckBoxLabel.setLabelValue("Free Check Box Label");
145:
146:                ItsNatFreeRadioButton freeRadioButton = (ItsNatFreeRadioButton) componentMgr
147:                        .findItsNatComponentById("freeRadioButtonId");
148:                check(freeRadioButton);
149:
150:                ItsNatFreeRadioButtonLabel freeRadioButtonLabel = (ItsNatFreeRadioButtonLabel) componentMgr
151:                        .findItsNatComponentById("freeRadioButtonLabelId");
152:                check(freeRadioButtonLabel);
153:                freeRadioButtonLabel.setLabelValue("Free Radio Button Label");
154:
155:                // Text Fields
156:
157:                ItsNatHTMLInputText inputText = (ItsNatHTMLInputText) componentMgr
158:                        .findItsNatComponentById("inputTextId");
159:                check(inputText);
160:                inputText.setText("Input Text");
161:
162:                ItsNatHTMLInputPassword inputPassword = (ItsNatHTMLInputPassword) componentMgr
163:                        .findItsNatComponentById("inputPasswordId");
164:                check(inputPassword);
165:                inputPassword.setText("Input Password");
166:
167:                ItsNatHTMLInputHidden inputHidden = (ItsNatHTMLInputHidden) componentMgr
168:                        .findItsNatComponentById("inputHiddenId");
169:                check(inputHidden);
170:
171:                ItsNatHTMLInputFile inputFile = (ItsNatHTMLInputFile) componentMgr
172:                        .findItsNatComponentById("inputFileId");
173:                check(inputFile);
174:
175:                ItsNatHTMLInputTextFormatted inputTextFormat = (ItsNatHTMLInputTextFormatted) componentMgr
176:                        .findItsNatComponentById("inputTextFormattedId");
177:                check(inputTextFormat);
178:                try {
179:                    inputTextFormat.setValue("Input Text Formatted");
180:                } catch (Exception ex) {
181:                }
182:
183:                // Text Area
184:                ItsNatHTMLTextArea textArea = (ItsNatHTMLTextArea) componentMgr
185:                        .findItsNatComponentById("textAreaId");
186:                check(textArea);
187:                textArea.setText("Text Area");
188:
189:                // Labels
190:
191:                ItsNatLabel label = (ItsNatLabel) componentMgr
192:                        .findItsNatComponentById("labelId");
193:                check(label);
194:                try {
195:                    label.setValue("Label");
196:                } catch (Exception ex) {
197:                }
198:
199:                ItsNatFreeLabel freeLabel = (ItsNatFreeLabel) componentMgr
200:                        .findItsNatComponentById("freeLabelId");
201:                check(freeLabel);
202:                try {
203:                    freeLabel.setValue("Free Label");
204:                } catch (Exception ex) {
205:                }
206:
207:                // Lists
208:
209:                ItsNatHTMLSelectComboBox selectCombo = (ItsNatHTMLSelectComboBox) componentMgr
210:                        .findItsNatComponentById("selectComboId");
211:                check(selectCombo);
212:                ((MutableComboBoxModel) selectCombo.getComboBoxModel())
213:                        .addElement("Option 1");
214:                ((MutableComboBoxModel) selectCombo.getComboBoxModel())
215:                        .addElement("Option 2");
216:
217:                ItsNatHTMLSelectMult selectList = (ItsNatHTMLSelectMult) componentMgr
218:                        .findItsNatComponentById("selectListId");
219:                check(selectList);
220:                ((DefaultListModel) selectList.getListModel())
221:                        .addElement("Option 1");
222:                ((DefaultListModel) selectList.getListModel())
223:                        .addElement("Option 2");
224:
225:                ItsNatFreeComboBox freeCombo = (ItsNatFreeComboBox) componentMgr
226:                        .findItsNatComponentById("freeComboBoxId");
227:                check(freeCombo);
228:                ((MutableComboBoxModel) freeCombo.getComboBoxModel())
229:                        .addElement("Option 1");
230:                ((MutableComboBoxModel) freeCombo.getComboBoxModel())
231:                        .addElement("Option 2");
232:
233:                ItsNatFreeListMultSel freeList = (ItsNatFreeListMultSel) componentMgr
234:                        .findItsNatComponentById("freeListId");
235:                check(freeList);
236:                ((DefaultListModel) freeList.getListModel())
237:                        .addElement("Option 1");
238:                ((DefaultListModel) freeList.getListModel())
239:                        .addElement("Option 2");
240:
241:                // Tables
242:
243:                ItsNatHTMLTable table = (ItsNatHTMLTable) componentMgr
244:                        .findItsNatComponentById("tableId");
245:                check(table);
246:                ((DefaultTableModel) table.getTableModel()).addColumn("Col 1");
247:                ((DefaultTableModel) table.getTableModel()).addColumn("Col 2");
248:                ((DefaultTableModel) table.getTableModel())
249:                        .addRow(new String[] { "Item 1,1", "Item 1,2" });
250:                ((DefaultTableModel) table.getTableModel())
251:                        .addRow(new String[] { "Item 2,1", "Item 2,2" });
252:
253:                ItsNatFreeTable freeTable = (ItsNatFreeTable) componentMgr
254:                        .findItsNatComponentById("freeTableId");
255:                check(freeTable);
256:                ((DefaultTableModel) freeTable.getTableModel())
257:                        .addColumn("Col 1");
258:                ((DefaultTableModel) freeTable.getTableModel())
259:                        .addColumn("Col 2");
260:                ((DefaultTableModel) freeTable.getTableModel())
261:                        .addRow(new String[] { "Item 1,1", "Item 1,2" });
262:                ((DefaultTableModel) freeTable.getTableModel())
263:                        .addRow(new String[] { "Item 2,1", "Item 2,2" });
264:
265:                ItsNatFreeTree freeTree = (ItsNatFreeTree) componentMgr
266:                        .findItsNatComponentById("freeTreeId");
267:                check(freeTree);
268:                ((DefaultTreeModel) freeTree.getTreeModel())
269:                        .setRoot(new DefaultMutableTreeNode("Free Tree"));
270:
271:                ItsNatFreeTree freeTreeRootless = (ItsNatFreeTree) componentMgr
272:                        .findItsNatComponentById("freeTreeRootlessId");
273:                check(freeTreeRootless);
274:                DefaultMutableTreeNode root = new DefaultMutableTreeNode(
275:                        "Root (hidden)");
276:                root.add(new DefaultMutableTreeNode("Free Tree Rootless"));
277:                ((DefaultTreeModel) freeTreeRootless.getTreeModel())
278:                        .setRoot(root);
279:
280:                ItsNatFreeTree freeTreeTable = (ItsNatFreeTree) componentMgr
281:                        .findItsNatComponentById("freeTreeTableId");
282:                check(freeTreeTable);
283:                ((DefaultTreeModel) freeTreeTable.getTreeModel())
284:                        .setRoot(new DefaultMutableTreeNode("Free Tree Table"));
285:
286:                ItsNatHTMLForm form = (ItsNatHTMLForm) componentMgr
287:                        .findItsNatComponentById("formId");
288:                check(form);
289:
290:                ItsNatFreeInclude freeInclude = (ItsNatFreeInclude) componentMgr
291:                        .findItsNatComponentById("freeIncludeId");
292:                check(freeInclude);
293:
294:                LoginComponent customComp = (LoginComponent) componentMgr
295:                        .findItsNatComponentById("customCompId");
296:                check(customComp);
297:
298:                ItsNatFreeListMultSel listCustomStruc = (ItsNatFreeListMultSel) componentMgr
299:                        .findItsNatComponentById("listCustomStructureId");
300:                check(listCustomStruc);
301:                check(listCustomStruc.getItsNatListStructure() instanceof  CityListCustomStructure);
302:                ((DefaultListModel) listCustomStruc.getListModel())
303:                        .addElement("Madrid");
304:                ((DefaultListModel) listCustomStruc.getListModel())
305:                        .addElement("Barcelona");
306:
307:                componentMgr.removeItsNatComponents(parentElem, true);// Disables/destroys all
308:            }
309:
310:            public void endExamplePanel() {
311:            }
312:
313:            public static void check(ItsNatComponent comp) {
314:                check(comp != null);
315:            }
316:
317:            public static void check(boolean eval) {
318:                if (!eval)
319:                    throw new RuntimeException("Unexpected Error");
320:            }
321:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.