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


001:        /*******************************************************************************
002:         * Copyright (c) 2006, 2007 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:         *     Tom Shindl <tom.schindl@bestsolution.at> - initial API and implementation
011:         *     											- bug fixes for 182443
012:         *******************************************************************************/package org.eclipse.jface.viewers;
013:
014:        import org.eclipse.swt.SWT;
015:        import org.eclipse.swt.custom.CLabel;
016:        import org.eclipse.swt.graphics.Color;
017:        import org.eclipse.swt.graphics.Font;
018:        import org.eclipse.swt.graphics.Image;
019:        import org.eclipse.swt.graphics.Point;
020:
021:        /**
022:         * The CellLabelProvider is an abstract implementation of a label provider for
023:         * structured viewers.
024:         * 
025:         * <p><b>This class is intended to be subclassed</b></p>
026:         * 
027:         * @since 3.3
028:         * @see ColumnLabelProvider as a concrete implementation
029:         */
030:        public abstract class CellLabelProvider extends BaseLabelProvider {
031:
032:            /**
033:             * Create a new instance of the receiver.
034:             */
035:            public CellLabelProvider() {
036:                super ();
037:            }
038:
039:            /**
040:             * Create a ViewerLabelProvider for the column at index
041:             * 
042:             * @param labelProvider
043:             *            The labelProvider to convert
044:             * @return ViewerLabelProvider
045:             */
046:            /* package */static CellLabelProvider createViewerLabelProvider(
047:                    ColumnViewer viewer, IBaseLabelProvider labelProvider) {
048:
049:                boolean noColumnTreeViewer = viewer instanceof  AbstractTreeViewer
050:                        && viewer.doGetColumnCount() == 0;
051:
052:                if (!noColumnTreeViewer
053:                        && (labelProvider instanceof  ITableLabelProvider
054:                                || labelProvider instanceof  ITableColorProvider || labelProvider instanceof  ITableFontProvider))
055:                    return new TableColumnViewerLabelProvider(labelProvider);
056:                if (labelProvider instanceof  CellLabelProvider)
057:                    return (CellLabelProvider) labelProvider;
058:                return new WrappedViewerLabelProvider(labelProvider);
059:
060:            }
061:
062:            /**
063:             * Get the image displayed in the tool tip for object.
064:             * 
065:             * <p>
066:             * <b>If {@link #getToolTipText(Object)} and
067:             * {@link #getToolTipImage(Object)} both return <code>null</code> the
068:             * control is set back to standard behavior</b>
069:             * </p>
070:             * 
071:             * @param object
072:             *            the element for which the tool tip is shown
073:             * @return {@link Image} or <code>null</code> if there is not image.
074:             */
075:
076:            public Image getToolTipImage(Object object) {
077:                return null;
078:            }
079:
080:            /**
081:             * Get the text displayed in the tool tip for object.
082:             * 
083:             * <p>
084:             * <b>If {@link #getToolTipText(Object)} and
085:             * {@link #getToolTipImage(Object)} both return <code>null</code> the
086:             * control is set back to standard behavior</b>
087:             * </p>
088:             * 
089:             * @param element
090:             *            the element for which the tool tip is shown
091:             * @return the {@link String} or <code>null</code> if there is not text to
092:             *         display
093:             */
094:            public String getToolTipText(Object element) {
095:                return null;
096:            }
097:
098:            /**
099:             * Return the background color used for the tool tip
100:             * 
101:             * @param object
102:             *            the {@link Object} for which the tool tip is shown
103:             * 
104:             * @return the {@link Color} used or <code>null</code> if you want to use
105:             *         the default color {@link SWT#COLOR_INFO_BACKGROUND}
106:             * @see SWT#COLOR_INFO_BACKGROUND
107:             */
108:            public Color getToolTipBackgroundColor(Object object) {
109:                return null;
110:            }
111:
112:            /**
113:             * The foreground color used to display the the text in the tool tip
114:             * 
115:             * @param object
116:             *            the {@link Object} for which the tool tip is shown
117:             * @return the {@link Color} used or <code>null</code> if you want to use
118:             *         the default color {@link SWT#COLOR_INFO_FOREGROUND}
119:             * @see SWT#COLOR_INFO_FOREGROUND
120:             */
121:            public Color getToolTipForegroundColor(Object object) {
122:                return null;
123:            }
124:
125:            /**
126:             * Get the {@link Font} used to display the tool tip
127:             * 
128:             * @param object
129:             *            the element for which the tool tip is shown
130:             * @return {@link Font} or <code>null</code> if the default font is to be
131:             *         used.
132:             */
133:            public Font getToolTipFont(Object object) {
134:                return null;
135:            }
136:
137:            /**
138:             * Return the amount of pixels in x and y direction you want the tool tip to
139:             * pop up from the mouse pointer. The default shift is 10px right and 0px
140:             * below your mouse cursor. Be aware of the fact that you should at least
141:             * position the tool tip 1px right to your mouse cursor else click events
142:             * may not get propagated properly.
143:             * 
144:             * @param object
145:             *            the element for which the tool tip is shown
146:             * @return {@link Point} to shift of the tool tip or <code>null</code> if the
147:             *         default shift should be used.
148:             */
149:            public Point getToolTipShift(Object object) {
150:                return null;
151:            }
152:
153:            /**
154:             * Return whether or not to use the native tool tip. If you switch to native
155:             * tool tips only the value from {@link #getToolTipText(Object)} is used all
156:             * other features from custom tool tips are not supported.
157:             * 
158:             * <p>
159:             * To reset the control to native behavior you should return
160:             * <code>true</code> from this method and <code>null</code> from
161:             * {@link #getToolTipText(Object)} or <code>null</code> from
162:             * {@link #getToolTipText(Object)} and {@link #getToolTipImage(Object)} at
163:             * the same time
164:             * </p>
165:             * 
166:             * @param object
167:             *            the {@link Object} for which the tool tip is shown
168:             * @return <code>true</code> if native tool tips should be used
169:             */
170:            public boolean useNativeToolTip(Object object) {
171:                return false;
172:            }
173:
174:            /**
175:             * The time in milliseconds the tool tip is shown for.
176:             * 
177:             * @param object
178:             *            the {@link Object} for which the tool tip is shown
179:             * @return time in milliseconds the tool tip is shown for
180:             */
181:            public int getToolTipTimeDisplayed(Object object) {
182:                return 0;
183:            }
184:
185:            /**
186:             * The time in milliseconds until the tool tip is displayed.
187:             * 
188:             * @param object
189:             *            the {@link Object} for which the tool tip is shown
190:             * @return time in milliseconds until the tool tip is displayed
191:             */
192:            public int getToolTipDisplayDelayTime(Object object) {
193:                return 0;
194:            }
195:
196:            /**
197:             * The {@link SWT} style used to create the {@link CLabel} (see there for
198:             * supported styles). By default {@link SWT#SHADOW_NONE} is used.
199:             * 
200:             * @param object
201:             *            the element for which the tool tip is shown
202:             * @return the style used to create the label
203:             * @see CLabel
204:             */
205:            public int getToolTipStyle(Object object) {
206:                return SWT.SHADOW_NONE;
207:            }
208:
209:            /**
210:             * Update the label for cell.
211:             * 
212:             * @param cell
213:             *            {@link ViewerCell}
214:             */
215:            public abstract void update(ViewerCell cell);
216:
217:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.