Source Code Cross Referenced for TreeDataEvent.java in  » Ajax » zk » org » zkoss » zul » event » 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 » zk » org.zkoss.zul.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* TreeDataEvent.java
002:
003:        {{IS_NOTE
004:        	Purpose:
005:        		
006:        	Description:
007:        		
008:        	History:
009:        		Aug 10 2007, Created by tomyeh
010:        }}IS_NOTE
011:
012:        Copyright (C) 2005 Potix Corporation. All Rights Reserved.
013:
014:        {{IS_RIGHT
015:        	This program is distributed under GPL Version 2.0 in the hope that
016:        	it will be useful, but WITHOUT ANY WARRANTY.
017:        }}IS_RIGHT
018:         */
019:        package org.zkoss.zul.event;
020:
021:        import org.zkoss.zul.TreeModel;
022:
023:        /**
024:         * Defines an event that encapsulates changes to a tree. 
025:         *
026:         * @author Jeff Liu
027:         * @since ZK 3.0.0
028:         */
029:        public class TreeDataEvent {
030:            /** Identifies changing contents of nodes. */
031:            public static final int CONTENTS_CHANGED = 0;
032:            /** Identifies the addition of children to a node. */
033:            public static final int INTERVAL_ADDED = 1;
034:            /** Identifies the removal of children to a node. */
035:            public static final int INTERVAL_REMOVED = 2;
036:
037:            private final TreeModel _model;
038:            private final int _type;
039:            private final int _indexFrom;
040:            private final int _indexTo;
041:            private final Object _parent;
042:
043:            /** Contructor.
044:             *
045:             * @param type one of {@link #CONTENTS_CHANGED},
046:             * {@link #INTERVAL_ADDED}, or {@link #INTERVAL_REMOVED}.
047:             * @param parent - the parent node that its children being modified .
048:             * @param indexFrom the lower index of the change range
049:             * @param indexTo the upper index of the change range
050:             */
051:            public TreeDataEvent(TreeModel model, int type, Object parent,
052:                    int indexFrom, int indexTo) {
053:                if (model == null)
054:                    throw new NullPointerException();
055:                checkInterval(indexFrom, indexTo, model.getChildCount(parent));
056:                _model = model;
057:                _type = type;
058:                _parent = parent;
059:                _indexFrom = indexFrom;
060:                _indexTo = indexTo;
061:            }
062:
063:            /*
064:             * Check the interval
065:             */
066:            private static void checkInterval(int from, int to, int len) {
067:                if (from > to)
068:                    throw new IllegalArgumentException(
069:                            "'from' should be less than or equal to 'to'. from: "
070:                                    + from + ", to: " + to);
071:                if (from < 0)
072:                    throw new ArrayIndexOutOfBoundsException(
073:                            "Out of bound. from : " + from);
074:            }
075:
076:            /** Returns the tree model that fires this event.
077:             */
078:            public TreeModel getModel() {
079:                return _model;
080:            }
081:
082:            /** Returns the event type. One of {@link #CONTENTS_CHANGED},
083:             * {@link #INTERVAL_ADDED}, or {@link #INTERVAL_REMOVED}.
084:             */
085:            public int getType() {
086:                return _type;
087:            }
088:
089:            /**
090:             * Returns the parent node that one of its children being modified 
091:             * @return the parent node that one of its children being modified 
092:             */
093:            public Object getParent() {
094:                return _parent;
095:            }
096:
097:            /**
098:             * Return the lower index of the change range
099:             * @return the lower index of the change range
100:             */
101:            public int getIndexFrom() {
102:                return _indexFrom;
103:            }
104:
105:            /**
106:             * Return the upper index of the change range
107:             * @return the upper index of the change range
108:             */
109:            public int getIndexTo() {
110:                return _indexTo;
111:            }
112:
113:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.