Source Code Cross Referenced for STextArea.java in  » Swing-Library » wings3 » org » 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 » Swing Library » wings3 » org.wings 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2000,2005 wingS development team.
003:         *
004:         * This file is part of wingS (http://wingsframework.org).
005:         *
006:         * wingS is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU Lesser General Public License
008:         * as published by the Free Software Foundation; either version 2.1
009:         * of the License, or (at your option) any later version.
010:         *
011:         * Please see COPYING for the complete licence.
012:         */
013:        package org.wings;
014:
015:        import org.wings.plaf.TextAreaCG;
016:        import org.wings.text.SDocument;
017:
018:        /**
019:         * Multilined input text area which requires a surrounding {@link SForm} element.
020:         * Can be also used as linebreaking label in disabled forms.
021:         *
022:         * @author <a href="mailto:armin.haaf@mercatis.de">Armin Haaf</a>
023:         */
024:        public class STextArea extends STextComponent {
025:
026:            /**
027:             * Text wrapping behaviour for {@link STextArea#setLineWrap(int)}: Don't wrap.
028:             */
029:            public final static int NO_WRAP = 0;
030:            /**
031:             * Text wrapping behaviour for {@link STextArea#setLineWrap(int)}: Wrap at width.
032:             */
033:            public final static int VIRTUAL_WRAP = 1;
034:            /**
035:             * Text wrapping behaviour for {@link STextArea#setLineWrap(int)}: Wrap at physical input box borders.
036:             */
037:            public final static int PHYSICAL_WRAP = 2;
038:
039:            private int rows = 0;
040:
041:            private int columns = 0;
042:
043:            /**
044:             * allowed parameters
045:             * are off(0), virtual(1), physical(2)
046:             * default value is off
047:             */
048:            private int lineWrap = NO_WRAP;
049:
050:            /**
051:             * Creates a TextArea with defaults
052:             */
053:            public STextArea() {
054:                this (null, 0, 0);
055:            }
056:
057:            /**
058:             * Creates a textArea with the given text
059:             * default values, no rows no columns no warp
060:             * @param text the text to display
061:             **/
062:            public STextArea(String text) {
063:                this (text, 0, 0);
064:            }
065:
066:            /**
067:             * Creates a new empty TextArea with the specified number of rows and columns.
068:             * @param rows is the number of rows to display
069:             * @param columns is the number of columns to display
070:             **/
071:            public STextArea(int rows, int columns) {
072:                this (null, rows, columns);
073:            }
074:
075:            /**
076:             * Creates a new TextArea with the specified text and number of rows and columns.
077:             * @param text is the text to display
078:             * @param rows is the number of rows to display
079:             * @param columns is the number of columns to display
080:             **/
081:            public STextArea(String text, int rows, int columns) {
082:                this (null, text, rows, columns);
083:            }
084:
085:            /**
086:             * Constructs a new STextArea with the given document model, and defaults
087:             * for all of the other arguments (null, 0, 0).
088:             *
089:             * @param doc  the model to use
090:             */
091:            public STextArea(SDocument doc) {
092:                this (doc, null, 0, 0);
093:            }
094:
095:            /**
096:             * Constructs a new STextArea with the specified number of rows
097:             * and columns, and the given model.  All of the constructors
098:             * feed through this constructor.
099:             *
100:             * @param doc the model to use, or create a default one if null
101:             * @param text the text to be displayed, null if none
102:             * @param rows the number of rows >= 0
103:             * @param columns the number of columns >= 0
104:             * @exception IllegalArgumentException if the rows or columns
105:             *  arguments are negative.
106:             */
107:            public STextArea(SDocument doc, String text, int rows, int columns) {
108:                super ();
109:                this .setText(text);
110:                this .setRows(rows);
111:                this .setColumns(columns);
112:                if (doc != null) {
113:                    setDocument(doc);
114:                }
115:            }
116:
117:            /**
118:             * Set the number of visble rows
119:             * @param r the number of visble rows
120:             */
121:            public void setRows(int r) {
122:                int oldRows = rows;
123:                rows = r;
124:                if (oldRows != rows)
125:                    reload();
126:            }
127:
128:            /**
129:             * Get the number of visble rows
130:             * @return number of visble rows
131:             */
132:            public int getRows() {
133:                return rows;
134:            }
135:
136:            /**
137:             * sets the Number of visible columns
138:             * @param c the number of columns
139:             */
140:            public void setColumns(int c) {
141:                int oldColumns = columns;
142:                columns = c;
143:                if (columns != oldColumns)
144:                    reload();
145:            }
146:
147:            /**
148:             * Current number of columns to display
149:             * @return the number of columns
150:             */
151:            public int getColumns() {
152:                return columns;
153:            }
154:
155:            /**
156:             * Valid values are {@link #NO_WRAP} {@link #VIRTUAL_WRAP} and {@link #PHYSICAL_WRAP}
157:             * @param lw
158:             */
159:            public void setLineWrap(int lw) {
160:                if (lw >= 0 && lw < 3)
161:                    lineWrap = lw;
162:            }
163:
164:            /**
165:             * @return one of the LineWraps, NO_WRAP, VIRTUAL_WRAP, PHYSICAL_WRAP
166:             */
167:            public int getLineWrap() {
168:                return lineWrap;
169:            }
170:
171:            public void setCG(TextAreaCG cg) {
172:                super.setCG(cg);
173:            }
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.