Source Code Cross Referenced for XLabelBinding.java in  » XML-UI » XUI » net » xoetrope » xui » data » 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 » XUI » net.xoetrope.xui.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.xoetrope.xui.data;
002:
003:        import java.awt.Component;
004:        import net.xoetrope.xui.XProjectManager;
005:        import net.xoetrope.xui.XTextHolder;
006:        import net.xoetrope.xml.XmlElement;
007:
008:        /**
009:         * <p>Bind an XLabel to a data model value/node. The binding allows a model node to
010:         * linked to a UI component so that it can be refreshed when new data is written
011:         * to the model. For a label component the source and destination area synonymous.
012:         * <p>Copyright: Copyright (c) Xoetrope Ltd., 1998-2003<br>
013:         * License:      see license.txt
014:         * @version $Revision: 1.21 $
015:         */
016:        public class XLabelBinding implements  XDataBinding {
017:            protected XTextHolder comp;
018:            protected XModel model;
019:            protected String srcPath;
020:
021:            /**
022:             * Construct a new data binding
023:             * @param c the component to be bound
024:             * @param dataElement the name of the data in the model
025:             */
026:            public XLabelBinding(Component c, String dataElement,
027:                    XModel srcModel) {
028:                srcPath = dataElement;
029:                model = srcModel;
030:                model.setTagName("data");
031:                comp = (XTextHolder) c;
032:            }
033:
034:            /**
035:             * Updates the TextComponent with the value obtained from the data model.
036:             */
037:            public void get() {
038:                comp.setText((String) model.get());
039:            }
040:
041:            /**
042:             * Updates the data model with the value retrieved from the TextComponent.
043:             */
044:            public void set() {
045:                model.set(comp.getText());
046:                ((Component) comp).repaint();
047:            }
048:
049:            /**
050:             * Gets the component on which this binding operates
051:             * @return the bound component
052:             */
053:            public Component getComponent() {
054:                return (Component) comp;
055:            }
056:
057:            /**
058:             * Gets the name of the model node
059:             * @return the name
060:             */
061:            public String getName() {
062:                return model.getAttribValueAsString(XBaseModel.ID_ATTRIBUTE);
063:            }
064:
065:            /**
066:             * Get the model component to which this object binds
067:             * @return
068:             */
069:            public String getSourcePath() {
070:                return srcPath;
071:            }
072:
073:            /**
074:             * Get the model component to which this object binds
075:             * @return
076:             */
077:            public String getOutputPath() {
078:                return srcPath;
079:            }
080:
081:            /**
082:             * Set the model path for the source data
083:             */
084:            public void setSourcePath(String newPath) {
085:                srcPath = newPath;
086:            }
087:
088:            /**
089:             * Set the model path for the output/state data
090:             */
091:            public void setOutputPath(String newPath) {
092:                srcPath = newPath;
093:            }
094:
095:            /**
096:             * Set the source node for data in the model
097:             * @param newNode the path of the data in the model
098:             */
099:            public void setSource(XModel newNode) {
100:                model = newNode;
101:            }
102:
103:            /**
104:             * Update the output node used by this adapter. The output node is used to
105:             * store selection data and state.
106:             * @param newNode the new model for saving the output data
107:             */
108:            public void setOutput(XModel newNode) {
109:                model = newNode;
110:            }
111:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.