Source Code Cross Referenced for PropertyCellRenderer.java in  » Workflow-Engines » osbl-1_0 » org » conform » wings » 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 » Workflow Engines » osbl 1_0 » org.conform.wings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* $Id: PropertyCellRenderer.java 812 2007-01-15 20:48:12Z hengels $ */
002:        package org.conform.wings;
003:
004:        import java.util.Collection;
005:
006:        import org.conform.AbstractPropertyData;
007:        import org.conform.BeanData;
008:        import org.conform.BeanMeta;
009:        import org.conform.Data;
010:        import org.conform.DomainProvider;
011:        import org.conform.PropertyMeta;
012:        import org.conform.TableData;
013:        import org.conform.ValidationEvent;
014:        import org.conform.ValidationListener;
015:        import org.conform.format.*;
016:        import org.wings.*;
017:        import org.wings.table.STableCellRenderer;
018:
019:        public class PropertyCellRenderer implements  STableCellRenderer,
020:                SListCellRenderer {
021:            private RendererPropertyData propertyData;
022:            private Editor editor;
023:            protected SComponent component;
024:            private SLabel label = new SLabel();
025:            StringBuffer nameBuffer = new StringBuffer();
026:            private PropertyMeta propertyMeta;
027:
028:            public PropertyCellRenderer(Editor editor, PropertyMeta property) {
029:                this .propertyMeta = property;
030:                this .editor = editor;
031:                this .component = editor.createComponent(property);
032:                this .component.setStyle(component.getStyle().replaceFirst(
033:                        "formeditor", "formlabel"));
034:                this .propertyData = new RendererPropertyData(property);
035:                this .editor.setPropertyData(component, propertyData);
036:                /*
037:                String alignment = (String)property.getAttribute(PropertyMeta.ATTRIBUTE_ALIGNMENT);
038:                if (alignment != null) {
039:                    if ("right".equals(alignment)) {
040:                        component.setHorizontalAlignment(SConstants.RIGHT_ALIGN);
041:                        component.setStyle(component.getStyle() + " right_align");
042:                    }
043:                    else if ("center".equals(alignment)) {
044:                        component.setHorizontalAlignment(SConstants.CENTER_ALIGN);
045:                        component.setStyle(component.getStyle() + " center_align");
046:                    }
047:                }
048:                 */
049:            }
050:
051:            public PropertyMeta getPropertyMeta() {
052:                return propertyMeta;
053:            }
054:
055:            public void configureComponent() {
056:                editor.configureComponent(propertyMeta, component, false);
057:                component.setStyle(component.getStyle().replaceFirst(
058:                        "formeditor", "formlabel"));
059:            }
060:
061:            public SComponent getTableCellRendererComponent(STable table,
062:                    Object value, boolean b, int row, int column) {
063:                propertyData.setValue(value);
064:                if (value == null && table.isCellEditable(row, column)) {
065:                    label.setText(null);
066:                    return label;
067:                }
068:
069:                if (propertyData.getPropertyMeta().isWritable()) {
070:                    if (table.getModel() instanceof  TableData) {
071:                        TableData tableData = (TableData) table.getModel();
072:                        propertyData.setValue(value);
073:                        BeanData delegateBeanData = tableData.getRowData(row);
074:                        propertyData.setDelegateFormData(delegateBeanData);
075:                    }
076:                    return component;
077:                } else {
078:                    /*
079:                    label.setText(getText());
080:                    label.setNameRaw(name(table, row, column));
081:                    return label;
082:                     */
083:                    return component;
084:                }
085:            }
086:
087:            public SComponent getListCellRendererComponent(SComponent list,
088:                    Object value, boolean isSelected, int index) {
089:                propertyData.setValue(value);
090:                return component;
091:            }
092:
093:            public String getText() {
094:                Object value = propertyData.getValue();
095:                if (value == null)
096:                    return null;
097:
098:                Format format = propertyData.getPropertyMeta().getFormat();
099:                if (format == null)
100:                    format = FormatFactory.NO_FORMAT;
101:
102:                return format.format(value);
103:            }
104:
105:            static class RendererPropertyData extends AbstractPropertyData {
106:                private Object value;
107:                private BeanData delegateBeanData;
108:
109:                protected RendererPropertyData(PropertyMeta property) {
110:                    super (null, property);
111:                }
112:
113:                public BeanMeta getBean() {
114:                    return null;
115:                }
116:
117:                public void setValue(Object value) {
118:                    this .value = value;
119:                }
120:
121:                public Object getValue() {
122:                    return value;
123:                }
124:
125:                public Data getRelationData() {
126:                    return delegateBeanData.getPropertyData(getPropertyMeta())
127:                            .getRelationData();
128:                }
129:
130:                public void addValidationListener(ValidationListener listener) {
131:                }
132:
133:                public void removeValidationListener(ValidationListener listener) {
134:                }
135:
136:                public void fireAddIssue(ValidationEvent event) {
137:                }
138:
139:                public void fireRemoveIssue(ValidationEvent event) {
140:                }
141:
142:                public void clear() {
143:                    value = null;
144:                }
145:
146:                public void flush() {
147:                }
148:
149:                protected void doSetValue(Object value) {
150:                }
151:
152:                protected Object doGetValue() {
153:                    return null;
154:                }
155:
156:                public void update() {
157:                }
158:
159:                public void setDelegateFormData(BeanData delegateBeanData) {
160:                    this .delegateBeanData = delegateBeanData;
161:                }
162:
163:                public void setInvalidValue(Object text) {
164:                }
165:
166:                public Object getInvalidValue() {
167:                    return null;
168:                }
169:            }
170:
171:            static class ReadOnlyProperty extends PropertyMeta {
172:                private PropertyMeta property;
173:
174:                public ReadOnlyProperty(PropertyMeta property) {
175:                    super (property.getBeanMeta(), property.getName(), property
176:                            .getType());
177:                    this .property = property;
178:                }
179:
180:                public String getName() {
181:                    return property.getName();
182:                }
183:
184:                public Class getType() {
185:                    return property.getType();
186:                }
187:
188:                public boolean isMandatory() {
189:                    return property.isMandatory();
190:                }
191:
192:                public boolean isWritable() {
193:                    return false;
194:                }
195:
196:                public boolean isReadable() {
197:                    return property.isReadable();
198:                }
199:
200:                public Collection getValidators() {
201:                    return property.getValidators();
202:                }
203:
204:                public int getPriority() {
205:                    return property.getPriority();
206:                }
207:
208:                public DomainProvider getDomainProvider() {
209:                    return property.getDomainProvider();
210:                }
211:
212:                public int getRelationType() {
213:                    return property.getRelationType();
214:                }
215:
216:                public BeanMeta getRelationBean() {
217:                    return property.getRelationBean();
218:                }
219:
220:                public PropertyMeta getRelationProperty() {
221:                    return property.getRelationProperty();
222:                }
223:
224:                public Object getAttribute(String name) {
225:                    return property.getAttribute(name);
226:                }
227:
228:                public void setName(String name) {
229:                }
230:
231:                public void setType(Class type) {
232:                }
233:
234:                public void setMandatory(boolean mandatory) {
235:                }
236:
237:                public void setWritable(boolean readonly) {
238:                }
239:
240:                public void setReadable(boolean visible) {
241:                }
242:
243:                public void setValidators(Collection validators) {
244:                }
245:
246:                public void setDefaultValue(Object defaultValue) {
247:                }
248:
249:                public void setDomainProvider(DomainProvider domainProvider) {
250:                }
251:
252:                public void setRelationType(int relationType) {
253:                }
254:
255:                public void setRelationBean(BeanMeta relationBean) {
256:                }
257:
258:                public void setRelationProperty(PropertyMeta relationProperty) {
259:                }
260:
261:                public void setAttribute(String name, Object value) {
262:                }
263:
264:                public void setPriority(int priority) {
265:                }
266:            }
267:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.