Source Code Cross Referenced for Item.java in  » IDE-Eclipse » swt » org » eclipse » swt » widgets » 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 » IDE Eclipse » swt » org.eclipse.swt.widgets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.swt.widgets;
011:
012:        import org.eclipse.swt.*;
013:        import org.eclipse.swt.graphics.*;
014:
015:        /**
016:         * This class is the abstract superclass of all non-windowed
017:         * user interface objects that occur within specific controls.
018:         * For example, a tree will contain tree items.
019:         * <dl>
020:         * <dt><b>Styles:</b></dt>
021:         * <dd>(none)</dd>
022:         * <dt><b>Events:</b></dt>
023:         * <dd>(none)</dd>
024:         * </dl>
025:         */
026:
027:        public abstract class Item extends Widget {
028:            String text;
029:            Image image;
030:
031:            /**
032:             * Constructs a new instance of this class given its parent
033:             * and a style value describing its behavior and appearance.
034:             * The item is added to the end of the items maintained by its parent.
035:             * <p>
036:             * The style value is either one of the style constants defined in
037:             * class <code>SWT</code> which is applicable to instances of this
038:             * class, or must be built by <em>bitwise OR</em>'ing together 
039:             * (that is, using the <code>int</code> "|" operator) two or more
040:             * of those <code>SWT</code> style constants. The class description
041:             * lists the style constants that are applicable to the class.
042:             * Style bits are also inherited from superclasses.
043:             * </p>
044:             *
045:             * @param parent a widget which will be the parent of the new instance (cannot be null)
046:             * @param style the style of item to construct
047:             *
048:             * @exception IllegalArgumentException <ul>
049:             *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
050:             * </ul>
051:             * @exception SWTException <ul>
052:             *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
053:             * </ul>
054:             *
055:             * @see SWT
056:             * @see Widget#getStyle
057:             */
058:            public Item(Widget parent, int style) {
059:                super (parent, style);
060:                text = "";
061:            }
062:
063:            /**
064:             * Constructs a new instance of this class given its parent
065:             * and a style value describing its behavior and appearance,
066:             * and the index at which to place it in the items maintained
067:             * by its parent.
068:             * <p>
069:             * The style value is either one of the style constants defined in
070:             * class <code>SWT</code> which is applicable to instances of this
071:             * class, or must be built by <em>bitwise OR</em>'ing together 
072:             * (that is, using the <code>int</code> "|" operator) two or more
073:             * of those <code>SWT</code> style constants. The class description
074:             * lists the style constants that are applicable to the class.
075:             * Style bits are also inherited from superclasses.
076:             * </p>
077:             *
078:             * @param parent a widget which will be the parent of the new instance (cannot be null)
079:             * @param style the style of item to construct
080:             * @param index the zero-relative index at which to store the receiver in its parent
081:             *
082:             * @exception IllegalArgumentException <ul>
083:             *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
084:             *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the parent (inclusive)</li>
085:             * </ul>
086:             * @exception SWTException <ul>
087:             *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
088:             * </ul>
089:             *
090:             * @see SWT
091:             * @see Widget#getStyle
092:             */
093:            public Item(Widget parent, int style, int index) {
094:                this (parent, style);
095:            }
096:
097:            protected void checkSubclass() {
098:                /* Do Nothing - Subclassing is allowed */
099:            }
100:
101:            /**
102:             * Returns the receiver's image if it has one, or null
103:             * if it does not.
104:             *
105:             * @return the receiver's image
106:             *
107:             * @exception SWTException <ul>
108:             *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
109:             *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
110:             * </ul>
111:             */
112:            public Image getImage() {
113:                checkWidget();
114:                return image;
115:            }
116:
117:            String getNameText() {
118:                return getText();
119:            }
120:
121:            /**
122:             * Returns the receiver's text, which will be an empty
123:             * string if it has never been set.
124:             *
125:             * @return the receiver's text
126:             *
127:             * @exception SWTException <ul>
128:             *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
129:             *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
130:             * </ul>
131:             */
132:            public String getText() {
133:                checkWidget();
134:                return text;
135:            }
136:
137:            void releaseWidget() {
138:                super .releaseWidget();
139:                text = null;
140:                image = null;
141:            }
142:
143:            /**
144:             * Sets the receiver's image to the argument, which may be
145:             * null indicating that no image should be displayed.
146:             *
147:             * @param image the image to display on the receiver (may be null)
148:             *
149:             * @exception IllegalArgumentException <ul>
150:             *    <li>ERROR_INVALID_ARGUMENT - if the image has been disposed</li> 
151:             * </ul>
152:             * @exception SWTException <ul>
153:             *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
154:             *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
155:             * </ul>
156:             */
157:            public void setImage(Image image) {
158:                checkWidget();
159:                if (image != null && image.isDisposed())
160:                    error(SWT.ERROR_INVALID_ARGUMENT);
161:                this .image = image;
162:            }
163:
164:            /**
165:             * Sets the receiver's text.
166:             *
167:             * @param string the new text
168:             *
169:             * @exception IllegalArgumentException <ul>
170:             *    <li>ERROR_NULL_ARGUMENT - if the text is null</li>
171:             * </ul>
172:             * @exception SWTException <ul>
173:             *    <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
174:             *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
175:             * </ul>
176:             */
177:            public void setText(String string) {
178:                checkWidget();
179:                if (string == null)
180:                    error(SWT.ERROR_NULL_ARGUMENT);
181:                text = string;
182:            }
183:
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.