Source Code Cross Referenced for ActionLinkBean.java in  » Portal » gridsphere » org » gridsphere » provider » portletui » beans » 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 » Portal » gridsphere » org.gridsphere.provider.portletui.beans 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * @author <a href="mailto:novotny@gridsphere.org">Jason Novotny</a>
003:         * @version $Id: ActionLinkBean.java 6424 2008-02-29 09:20:31Z wehrens $
004:         */package org.gridsphere.provider.portletui.beans;
005:
006:        import java.util.ArrayList;
007:        import java.util.List;
008:
009:        /**
010:         * An <code>ActionLinkBean</code> is a visual bean that represents a hyperlink containing a portlet action
011:         */
012:        public class ActionLinkBean extends ActionBean implements  TagBean {
013:
014:            protected String style = "none";
015:            protected List<TagBean> beans = new ArrayList<TagBean>();
016:
017:            /**
018:             * Constructs a default action link bean
019:             */
020:            public ActionLinkBean() {
021:            }
022:
023:            /**
024:             * Constructs an action link bean from a portlet request and supplied bean identifier
025:             *
026:             * @param beanId the bean id used to reference this ActionLinkBean
027:             */
028:            public ActionLinkBean(String beanId) {
029:                this .beanId = beanId;
030:            }
031:
032:            /**
033:             * Returns the style of the text: Available styles are
034:             * <ul>
035:             * <li>nostyle - plain text</li>
036:             * <li>error - error text</li>
037:             * <li>info - default info text</li>
038:             * <li>status - status text</li>
039:             * <li>alert - alert text</li>
040:             * <li>success - success text</li>
041:             *
042:             * @return the text style
043:             */
044:            public String getStyle() {
045:                return style;
046:            }
047:
048:            /**
049:             * Sets the style of the text: Available styles are
050:             * <ul>
051:             * <li>error</li>
052:             * <li>info</li>
053:             * <li>status</li>
054:             * <li>alert</li>
055:             * <li>success</li>
056:             *
057:             * @param style the text style
058:             */
059:            public void setStyle(String style) {
060:                this .style = style;
061:            }
062:
063:            /**
064:             * Gets the beans to be rendered before the text in the ActionLink.
065:             *
066:             * @return TagBean
067:             */
068:
069:            public List<TagBean> getTagBeans() {
070:                return beans;
071:            }
072:
073:            /**
074:             * Sets  beans to be rendered before the text in the ActionLink.
075:             *
076:             * @param beans Bean to be rendered
077:             */
078:            public void setTagBeans(List<TagBean> beans) {
079:                this .beans = beans;
080:            }
081:
082:            public String toStartString() {
083:                return "";
084:            }
085:
086:            public String toEndString() {
087:                // now do the string rendering
088:                action = this .portletURI.toString();
089:
090:                if (anchor != null)
091:                    action += "#" + anchor;
092:
093:                //String hlink = "<a href=\"" + action + "\"" + " onClick=\"this.href='" + action + "&amp;JavaScript=enabled'\"/>" + value + "</a>";
094:                if (style.equalsIgnoreCase("error")
095:                        || (style.equalsIgnoreCase("err"))) {
096:                    this .cssClass = MessageStyle.MSG_ERROR;
097:                } else if (style.equalsIgnoreCase("status")) {
098:                    this .cssClass = MessageStyle.MSG_STATUS;
099:                } else if (style.equalsIgnoreCase("info")) {
100:                    this .cssClass = MessageStyle.MSG_INFO;
101:                } else if (style.equalsIgnoreCase("alert")) {
102:                    this .cssClass = MessageStyle.MSG_ALERT;
103:                } else if (style.equalsIgnoreCase("success")) {
104:                    this .cssClass = MessageStyle.MSG_SUCCESS;
105:                } else if (style.equalsIgnoreCase(MessageStyle.MSG_BOLD)) {
106:                    this .addCssStyle("font-weight: bold;");
107:                } else if (style.equalsIgnoreCase(MessageStyle.MSG_ITALIC)) {
108:                    this .addCssStyle("font-style: italic;");
109:                } else if (style.equalsIgnoreCase(MessageStyle.MSG_UNDERLINE)) {
110:                    this .addCssStyle("text-decoration: underline;");
111:                }
112:                StringBuffer sb = new StringBuffer();
113:                sb.append("<a");
114:                if (name != null)
115:                    sb.append(" name=\"").append(name).append("\"");
116:                if (id != null)
117:                    sb.append(" id=\"").append(id).append("\" ");
118:                if (useAjax)
119:                    action = "#";
120:                sb.append(" href=\"").append(action).append("\"");
121:
122:                sb.append(getFormattedCss());
123:                if (onClick != null)
124:                    sb.append(" onclick=\"").append(onClick).append("\"");
125:                if (onMouseOut != null)
126:                    sb.append(" onMouseOut=\"").append(onMouseOut).append("\"");
127:                if (onMouseOver != null)
128:                    sb.append(" onMouseOver=\"").append(onMouseOver).append(
129:                            "\"");
130:                sb.append(">");
131:
132:                for (TagBean bean : beans) {
133:                    sb.append(bean.toStartString());
134:                    sb.append(bean.toEndString());
135:                }
136:
137:                sb.append(value).append("</a>");
138:                return sb.toString();
139:            }
140:
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.