Lines 26-33
Link Here
|
26 |
* |
26 |
* |
27 |
* @since 3.3 |
27 |
* @since 3.3 |
28 |
*/ |
28 |
*/ |
29 |
public abstract class CellLabelProvider extends BaseLabelProvider { |
29 |
public abstract class CellLabelProvider extends BaseLabelProvider { |
30 |
|
|
|
31 |
|
30 |
|
32 |
/** |
31 |
/** |
33 |
* Create a new instance of the receiver. |
32 |
* Create a new instance of the receiver. |
Lines 43-49
Link Here
|
43 |
* The labelProvider to convert |
42 |
* The labelProvider to convert |
44 |
* @return ViewerLabelProvider |
43 |
* @return ViewerLabelProvider |
45 |
*/ |
44 |
*/ |
46 |
/* package */ static CellLabelProvider createViewerLabelProvider( |
45 |
/* package */static CellLabelProvider createViewerLabelProvider( |
47 |
IBaseLabelProvider labelProvider) { |
46 |
IBaseLabelProvider labelProvider) { |
48 |
|
47 |
|
49 |
if (labelProvider instanceof ITableLabelProvider |
48 |
if (labelProvider instanceof ITableLabelProvider |
Lines 56-67
Link Here
|
56 |
|
55 |
|
57 |
} |
56 |
} |
58 |
|
57 |
|
59 |
|
|
|
60 |
/** |
58 |
/** |
61 |
* Get the image displayed in the tool tip for object. |
59 |
* Get the image displayed in the tool tip for object. |
62 |
* |
60 |
* |
63 |
* <p><b>if both methods {@link #getToolTipText(Object)} and {@link #getToolTipImage(Object)} |
61 |
* <p> |
64 |
* both return <code>null</code> the control is set back to standard behaviour</b></p> |
62 |
* <b>If {@link #getToolTipText(Object)} and |
|
|
63 |
* {@link #getToolTipImage(Object)} both return <code>null</code> the |
64 |
* control is set back to standard behavior</b> |
65 |
* </p> |
65 |
* |
66 |
* |
66 |
* @param object |
67 |
* @param object |
67 |
* the element for which the tool tip is shown |
68 |
* the element for which the tool tip is shown |
Lines 73-88
Link Here
|
73 |
} |
74 |
} |
74 |
|
75 |
|
75 |
/** |
76 |
/** |
76 |
* Returns the tool tip text for the given element and column index, or |
77 |
* Get the text displayed in the tool tip for object. |
77 |
* <code>null</code> if a custom tool tip should not be displayed. |
|
|
78 |
* |
78 |
* |
79 |
* <p><b>if both methods {@link #getToolTipText(Object)} and {@link #getToolTipImage(Object)} |
79 |
* <p> |
80 |
* both return <code>null</code> the control is set back to standard behaviour</b></p> |
80 |
* <b>If {@link #getToolTipText(Object)} and |
|
|
81 |
* {@link #getToolTipImage(Object)} both return <code>null</code> the |
82 |
* control is set back to standard behavior</b> |
83 |
* </p> |
81 |
* |
84 |
* |
82 |
* @param element |
85 |
* @param element |
83 |
* the element for which the tool tip is shown |
86 |
* the element for which the tool tip is shown |
84 |
* @return the {@link String} to be displayed in the tool tip, or |
87 |
* @return the {@link String} or <code>null</code> if there is not text to |
85 |
* <code>null</code> if a custom tool tip should not be displayed |
88 |
* display |
86 |
*/ |
89 |
*/ |
87 |
public String getToolTipText(Object element) { |
90 |
public String getToolTipText(Object element) { |
88 |
return null; |
91 |
return null; |
Lines 95-101
Link Here
|
95 |
* the {@link Object} for which the tool tip is shown |
98 |
* the {@link Object} for which the tool tip is shown |
96 |
* |
99 |
* |
97 |
* @return the {@link Color} used or <code>null</code> if you want to use |
100 |
* @return the {@link Color} used or <code>null</code> if you want to use |
98 |
* the |
101 |
* the default color {@link SWT#COLOR_INFO_BACKGROUND} |
|
|
102 |
* @see SWT#COLOR_INFO_BACKGROUND |
99 |
*/ |
103 |
*/ |
100 |
public Color getToolTipBackgroundColor(Object object) { |
104 |
public Color getToolTipBackgroundColor(Object object) { |
101 |
return null; |
105 |
return null; |
Lines 135-141
Link Here
|
135 |
* |
139 |
* |
136 |
* @param object |
140 |
* @param object |
137 |
* the element for which the tool tip is shown |
141 |
* the element for which the tool tip is shown |
138 |
* @return {@link Point} shift of the tool tip or <code>null</code> if the |
142 |
* @return {@link Point} to shift of the tool tip or <code>null</code> if the |
139 |
* default shift should be used. |
143 |
* default shift should be used. |
140 |
*/ |
144 |
*/ |
141 |
public Point getToolTipShift(Object object) { |
145 |
public Point getToolTipShift(Object object) { |
Lines 143-156
Link Here
|
143 |
} |
147 |
} |
144 |
|
148 |
|
145 |
/** |
149 |
/** |
146 |
* Return whether or not to use the native tool tip. If you switch to native tool tips |
150 |
* Return whether or not to use the native tool tip. If you switch to native |
147 |
* only the value from {@link #getToolTipText(Object)} is used all other features from |
151 |
* tool tips only the value from {@link #getToolTipText(Object)} is used all |
148 |
* custom tooltips are not supported. |
152 |
* other features from custom tool tips are not supported. |
149 |
* |
153 |
* |
150 |
* <p>To reset the control to native behaviour you should return <code>true</code> from this method |
154 |
* <p> |
151 |
* and <code>null</code> from {@link #getToolTipText(Object)} or <code>null</code> |
155 |
* To reset the control to native behavior you should return |
152 |
* from {@link #getToolTipText(Object)} and {@link #getToolTipImage(Object)} |
156 |
* <code>true</code> from this method and <code>null</code> from |
153 |
* at the same time</p> |
157 |
* {@link #getToolTipText(Object)} or <code>null</code> from |
|
|
158 |
* {@link #getToolTipText(Object)} and {@link #getToolTipImage(Object)} at |
159 |
* the same time |
160 |
* </p> |
154 |
* |
161 |
* |
155 |
* @param object |
162 |
* @param object |
156 |
* the {@link Object} for which the tool tip is shown |
163 |
* the {@link Object} for which the tool tip is shown |
Lines 165-194
Link Here
|
165 |
* |
172 |
* |
166 |
* @param object |
173 |
* @param object |
167 |
* the {@link Object} for which the tool tip is shown |
174 |
* the {@link Object} for which the tool tip is shown |
168 |
* @return <code>int<code> |
175 |
* @return time in milliseconds the tool tip is shown for |
169 |
*/ |
176 |
*/ |
170 |
public int getToolTipTimeDisplayed(Object object) { |
177 |
public int getToolTipTimeDisplayed(Object object) { |
171 |
return 0; |
178 |
return 0; |
172 |
} |
179 |
} |
173 |
|
180 |
|
174 |
/** |
181 |
/** |
175 |
* The time in milliseconds until the tool tip is displaued. |
182 |
* The time in milliseconds until the tool tip is displayed. |
176 |
* |
183 |
* |
177 |
* @param object |
184 |
* @param object |
178 |
* the {@link Object} for which the tool tip is shown |
185 |
* the {@link Object} for which the tool tip is shown |
179 |
* @return int |
186 |
* @return time in milliseconds until the tool tip is displayed |
180 |
*/ |
187 |
*/ |
181 |
public int getToolTipDisplayDelayTime(Object object) { |
188 |
public int getToolTipDisplayDelayTime(Object object) { |
182 |
return 0; |
189 |
return 0; |
183 |
} |
190 |
} |
184 |
|
191 |
|
185 |
/** |
192 |
/** |
186 |
* The {@link SWT} style used to create the {@link CLabel} (see there for supported styles). |
193 |
* The {@link SWT} style used to create the {@link CLabel} (see there for |
187 |
* By default {@link SWT#SHADOW_NONE} is used. |
194 |
* supported styles). By default {@link SWT#SHADOW_NONE} is used. |
188 |
* |
195 |
* |
189 |
* @param object |
196 |
* @param object |
190 |
* the element for which the tool tip is shown |
197 |
* the element for which the tool tip is shown |
191 |
* @return int |
198 |
* @return the style used to create the label |
192 |
* @see CLabel |
199 |
* @see CLabel |
193 |
*/ |
200 |
*/ |
194 |
public int getToolTipStyle(Object object) { |
201 |
public int getToolTipStyle(Object object) { |
Lines 198-204
Link Here
|
198 |
/** |
205 |
/** |
199 |
* Update the label for cell. |
206 |
* Update the label for cell. |
200 |
* |
207 |
* |
201 |
* @param cell {@link ViewerCell} |
208 |
* @param cell |
|
|
209 |
* {@link ViewerCell} |
202 |
*/ |
210 |
*/ |
203 |
public abstract void update(ViewerCell cell); |
211 |
public abstract void update(ViewerCell cell); |
204 |
|
212 |
|