Source Code Cross Referenced for TextEditorBean.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:        package org.gridsphere.provider.portletui.beans;
002:
003:        import org.gridsphere.portlet.service.spi.PortletServiceFactory;
004:        import org.gridsphere.services.core.portal.PortalConfigService;
005:
006:        /**
007:         * The <code>TextEditorBean</code> represents a text editor provided
008:         * by Cezary Tomczak at http://gosu.pl/dhtml/SimpleTextEditor.html
009:         */
010:        public class TextEditorBean extends BaseComponentBean implements 
011:                TagBean {
012:
013:            private int cols = 0;
014:            private int rows = 0;
015:            private String value = null;
016:            private String action = null;
017:            private boolean viewsource = true;
018:
019:            /**
020:             * Constructs a default text area bean
021:             */
022:            public TextEditorBean() {
023:                super (TagBean.TEXTEDITOR_NAME);
024:            }
025:
026:            /**
027:             * Constructs a text area bean from a supplied portlet request and bean identifier
028:             *
029:             * @param beanId the bean identifier
030:             */
031:            public TextEditorBean(String beanId) {
032:                super (TagBean.TEXTEDITOR_NAME);
033:                this .beanId = beanId;
034:            }
035:
036:            /**
037:             * Returns true if text editor should allow users to edit/view HTML source
038:             *
039:             * @return true if text editor should allow users to edit/view HTML source
040:             */
041:            public boolean getViewsource() {
042:                return viewsource;
043:            }
044:
045:            /**
046:             * Set to true if text editor should allow users to edit/view HTML source
047:             *
048:             * @param viewsource is true if text editor should allow users to edit/view HTML source
049:             */
050:            public void setViewsource(boolean viewsource) {
051:                this .viewsource = viewsource;
052:            }
053:
054:            public String getAction() {
055:                return action;
056:            }
057:
058:            public void setAction(String action) {
059:                this .action = action;
060:            }
061:
062:            /**
063:             * Gets the number of columns of the TextArea.
064:             *
065:             * @return number of columns
066:             */
067:            public int getCols() {
068:                return cols;
069:            }
070:
071:            /**
072:             * Sets the number of columns of the TextArea.
073:             *
074:             * @param cols number of cols
075:             */
076:            public void setCols(int cols) {
077:                this .cols = cols;
078:            }
079:
080:            /**
081:             * Return the number of rows of the textarea.
082:             *
083:             * @return number of rows
084:             */
085:            public int getRows() {
086:                return rows;
087:            }
088:
089:            /**
090:             * Sets the number of rows of the textarea.
091:             *
092:             * @param rows number of rows
093:             */
094:            public void setRows(int rows) {
095:                this .rows = rows;
096:            }
097:
098:            /**
099:             * Sets the bean value
100:             *
101:             * @param value the bean value
102:             */
103:            public void setValue(String value) {
104:                this .value = value;
105:            }
106:
107:            /**
108:             * Returns the bean value
109:             *
110:             * @return the bean value
111:             */
112:            public String getValue() {
113:                return value;
114:            }
115:
116:            public String toStartString() {
117:                PortalConfigService configService = (PortalConfigService) PortletServiceFactory
118:                        .createPortletService(PortalConfigService.class, true);
119:                // deal with ROOT context case
120:                String contextPath = configService
121:                        .getProperty("gridsphere.deploy");
122:                if (!contextPath.equals(""))
123:                    contextPath = "/" + contextPath;
124:                renderResponse.setProperty("CSS_HREF", contextPath
125:                        + "/css/SimpleTextEditor.css");
126:                renderResponse.addProperty("JAVASCRIPT_SRC", contextPath
127:                        + "/javascript/SimpleTextEditor.js");
128:                StringBuffer sb = new StringBuffer();
129:                sb.append("<form action=\"" + action + "\" method=\"post\">");
130:                String sname = createTagName(name);
131:                sb.append("<textarea id=\"body\" name=\"" + sname
132:                        + "\" cols=\"" + cols + "\" rows=\"" + rows + "\">");
133:                return sb.toString();
134:            }
135:
136:            public String toEndString() {
137:                StringBuffer sb = new StringBuffer();
138:                String result = (value != null) ? value : "";
139:                sb.append(result + "</textarea>");
140:                sb.append("<script type=\"text/javascript\">");
141:                String sname = createTagName(name);
142:                sb.append("var ste = new SimpleTextEditor(\"body\", \"" + sname
143:                        + "\", " + viewsource + ", \"ste\");");
144:                sb.append("ste.init();");
145:                sb.append("</script>");
146:                sb
147:                        .append("<input type=\"submit\" value=\"Submit\" onclick=\"ste.submit();\">");
148:                sb.append("</form>");
149:                return sb.toString();
150:            }
151:
152:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.