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


001:        package org.osbl.agent.gui.action;
002:
003:        import java.util.List;
004:
005:        import org.conform.BeanMeta;
006:        import org.conform.PropertyMeta;
007:        import org.osbl.agent.gui.ActionController;
008:        import org.osbl.agent.gui.OperationController;
009:        import org.osbl.agent.model.Action;
010:        import org.osbl.agent.model.action.SetPropertyAction;
011:        import org.osbl.client.wings.shell.Client;
012:        import org.wings.SComponent;
013:        import org.wings.SLabel;
014:
015:        /**
016:         * The class SetPropertyActionController models a SetPropertyAction.
017:         * 
018:         * Depending on the type of the property, it presents different ways to enter 
019:         * the value to assign.
020:         * 
021:         * This is implemented by the subclasses.
022:         * 
023:         * @author Sebastian Nozzi.
024:         */
025:        public abstract class SetPropertyActionController extends
026:                ActionController {
027:
028:            /** The property meta information. */
029:            private PropertyMeta propertyMeta;
030:
031:            /* (non-Javadoc)
032:             * @see org.osbl.agent.gui.ActionController#setAction(org.osbl.agent.model.Action)
033:             */
034:            public void setAction(Action action) {
035:
036:                String className = ((SetPropertyAction) action)
037:                        .getBeanMetaClassName();
038:                String propertyName = ((SetPropertyAction) action)
039:                        .getPropertyMetaName();
040:
041:                try {
042:                    BeanMeta beanMeta = Client.getInstance()
043:                            .getBeanMetaProvider().getBeanMeta(
044:                                    Class.forName(className));
045:                    setPropertyMeta(beanMeta.getProperty(propertyName));
046:                } catch (ClassNotFoundException e) {
047:                    // TODO Auto-generated catch block
048:                    e.printStackTrace();
049:                }
050:            }
051:
052:            /* (non-Javadoc)
053:             * @see org.osbl.agent.gui.OperationController#canBeReplacedBy(org.osbl.agent.gui.OperationController)
054:             */
055:            public boolean canBeReplacedBy(
056:                    OperationController candidateController) {
057:
058:                // We can be replaced only by another SetPropertyActionController 
059:                // that also changes the same property as we do.
060:                if (candidateController instanceof  SetPropertyActionController)
061:                    return ((SetPropertyActionController) candidateController).propertyMeta
062:                            .equals(this .propertyMeta);
063:                else
064:                    return false;
065:            }
066:
067:            /* (non-Javadoc)
068:             * @see org.osbl.agent.gui.OperationController#populateComponentList(java.util.List)
069:             */
070:            protected void populateComponentList(List<SComponent> componentList) {
071:
072:                // A label to show that the property will be set to some value.
073:                componentList.add(new SLabel(msg("setTo")));
074:
075:            }
076:
077:            /**
078:             * Gets the property meta.
079:             * 
080:             * @return the property meta
081:             */
082:            public PropertyMeta getPropertyMeta() {
083:                return propertyMeta;
084:            }
085:
086:            /**
087:             * Sets the property meta.
088:             * 
089:             * @param propertyMeta the new property meta
090:             */
091:            public void setPropertyMeta(PropertyMeta propertyMeta) {
092:                this .propertyMeta = propertyMeta;
093:            }
094:
095:            /* (non-Javadoc)
096:             * @see java.lang.Object#toString()
097:             */
098:            public String toString() {
099:                // Our string version is the property we want to change, indented.
100:                return "  " + propertyMeta.getLabel() + "   ("
101:                        + propertyMeta.getName() + ")";
102:            }
103:
104:            /* (non-Javadoc)
105:             * @see org.osbl.agent.gui.ActionController#populateAction(org.osbl.agent.model.Action)
106:             */
107:            protected void populateAction(Action action) {
108:
109:                // Set the propertyMeta of the SetCurrentTimeAction to whatever propertyMeta
110:                // the user chose in the UI.
111:                ((SetPropertyAction) action).setBeanMetaClassName(propertyMeta
112:                        .getBeanMeta().getName());
113:                ((SetPropertyAction) action).setPropertyMetaName(propertyMeta
114:                        .getName());
115:
116:            }
117:
118:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.