Source Code Cross Referenced for Gui4jInternalActionCall.java in  » XML-UI » gui4j » org » gui4j » core » call » 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 » gui4j » org.gui4j.core.call 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.gui4j.core.call;
002:
003:        import java.awt.Component;
004:        import java.awt.event.ActionEvent;
005:        import java.util.Collections;
006:        import java.util.Map;
007:        import java.util.Set;
008:
009:        import javax.swing.Action;
010:        import javax.swing.ActionMap;
011:        import javax.swing.JComponent;
012:
013:        import org.apache.commons.logging.Log;
014:        import org.apache.commons.logging.LogFactory;
015:
016:        import org.gui4j.Gui4jCallBase;
017:        import org.gui4j.core.Gui4jCall;
018:        import org.gui4j.core.Gui4jComponent;
019:        import org.gui4j.core.Gui4jComponentInstance;
020:        import org.gui4j.core.Gui4jMap1;
021:        import org.gui4j.core.Gui4jThreadManager;
022:
023:        public final class Gui4jInternalActionCall implements  Gui4jCall {
024:            private static final Log log = LogFactory
025:                    .getLog(Gui4jInternalActionCall.class);
026:
027:            private final Gui4jComponent mGui4jComponent;
028:            private final String mActionKey;
029:
030:            public Gui4jInternalActionCall(Gui4jComponent gui4jComponent,
031:                    String actionKey) {
032:                this .mGui4jComponent = gui4jComponent;
033:                this .mActionKey = actionKey;
034:
035:                log.debug("Gui4jInternalActionCall created for: " + actionKey);
036:            }
037:
038:            public Gui4jCall[] getDependantProperties() {
039:                return null;
040:            }
041:
042:            public boolean hasTriggerEvents() {
043:                return false;
044:            }
045:
046:            public Class getResultClass() {
047:                return null;
048:            }
049:
050:            public Object getValue(Gui4jCallBase gui4jController, Map paramMap,
051:                    Object defaultValue) {
052:                return getValueNoErrorChecking(gui4jController, paramMap, null);
053:            }
054:
055:            public Class getValueClass() {
056:                return null;
057:            }
058:
059:            public Class getValueClass(String paramName) {
060:                return null;
061:            }
062:
063:            public Set getUsedParams() {
064:                return Collections.EMPTY_SET;
065:            }
066:
067:            public Object getValueNoParams(Gui4jCallBase baseInstance,
068:                    Object defaultValue) {
069:                return getValueNoErrorChecking(baseInstance, null, null);
070:            }
071:
072:            public Object getValueUseDefaultParam(Gui4jCallBase baseInstance,
073:                    Object defaultParamValue, Object defaultValue) {
074:                return getValueNoErrorChecking(baseInstance, new Gui4jMap1("",
075:                        defaultParamValue), null);
076:            }
077:
078:            public String getConfigurationName() {
079:                return mGui4jComponent.getGui4jComponentContainer()
080:                        .getConfigurationName();
081:            }
082:
083:            public Object getValueNoErrorChecking(Gui4jCallBase callBase,
084:                    Map paramMap, Gui4jComponentInstance componentInstance) {
085:                return performAction(componentInstance);
086:            }
087:
088:            private Object performAction(Gui4jComponentInstance instance) {
089:                if (instance == null) {
090:                    log
091:                            .warn("Cannot perform internal action because Gui4jComponentInstance is not supplied.");
092:                    return null;
093:                }
094:                final Action action = findAction(instance);
095:                if (action != null) {
096:                    Gui4jThreadManager
097:                            .executeInSwingThreadAndContinue(new Runnable() {
098:
099:                                public void run() {
100:                                    action.actionPerformed(new ActionEvent(
101:                                            this , 0, mActionKey));
102:                                }
103:                            });
104:                }
105:                return null;
106:            }
107:
108:            private Action findAction(Gui4jComponentInstance instance) {
109:                // Find named action in swing container hierarchy
110:                Component component = instance.getComponent();
111:                while (component != null) {
112:                    if (component instanceof  JComponent) {
113:                        JComponent jcomponent = (JComponent) component;
114:                        ActionMap actionMap = jcomponent.getActionMap();
115:                        Action action = actionMap.get(mActionKey);
116:                        if (action != null) {
117:                            log.debug("Action found: " + action);
118:                            return action;
119:                        }
120:                    }
121:                    component = component.getParent();
122:                }
123:                return null;
124:            }
125:
126:            public String toString() {
127:                return "Internal Action for: " + mActionKey;
128:            }
129:
130:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.