Lines 205-215
Link Here
|
205 |
List descriptors = computeMergedPropertyDescriptors(); |
205 |
List descriptors = computeMergedPropertyDescriptors(); |
206 |
|
206 |
|
207 |
// rebuild child entries using old when possible |
207 |
// rebuild child entries using old when possible |
208 |
childEntries = new PropertySheetEntry[descriptors.size()]; |
208 |
childEntries = createChildEntries(descriptors.size()); |
209 |
for (int i = 0; i < descriptors.size(); i++) { |
209 |
for (int i = 0; i < descriptors.size(); i++) { |
210 |
IPropertyDescriptor d = (IPropertyDescriptor)descriptors.get(i); |
210 |
IPropertyDescriptor d = (IPropertyDescriptor)descriptors.get(i); |
211 |
// create new entry |
211 |
// create new entry |
212 |
PropertySheetEntry entry = new PropertySheetEntry(); |
212 |
PropertySheetEntry entry = createChildEntry(); |
213 |
entry.setDescriptor(d); |
213 |
entry.setDescriptor(d); |
214 |
entry.setParent(this); |
214 |
entry.setParent(this); |
215 |
entry.setPropertySourceProvider(propertySourceProvider); |
215 |
entry.setPropertySourceProvider(propertySourceProvider); |
Lines 217-222
Link Here
|
217 |
childEntries[i] = entry; |
217 |
childEntries[i] = entry; |
218 |
} |
218 |
} |
219 |
} |
219 |
} |
|
|
220 |
/** |
221 |
* Return a new array of property sheet entries of the given size |
222 |
* @param size size of the new array |
223 |
* @return array of new property sheet entries |
224 |
*/ |
225 |
protected PropertySheetEntry[] createChildEntries(int size) { |
226 |
return new PropertySheetEntry[size]; |
227 |
} |
228 |
/** |
229 |
* Return a new <code>PropertySheetEntry</code>. |
230 |
* @return new <code>PropertySheetEntry</code> |
231 |
*/ |
232 |
protected PropertySheetEntry createChildEntry() { |
233 |
return new PropertySheetEntry(); |
234 |
} |
220 |
/* (non-Javadoc) |
235 |
/* (non-Javadoc) |
221 |
* Method declared on IPropertySheetEntry. |
236 |
* Method declared on IPropertySheetEntry. |
222 |
*/ |
237 |
*/ |
Lines 299-305
Link Here
|
299 |
* Returns the descriptor for this entry. |
314 |
* Returns the descriptor for this entry. |
300 |
* @return IPropertyDescriptor |
315 |
* @return IPropertyDescriptor |
301 |
*/ |
316 |
*/ |
302 |
private IPropertyDescriptor getDescriptor() { |
317 |
protected IPropertyDescriptor getDescriptor() { |
303 |
return descriptor; |
318 |
return descriptor; |
304 |
} |
319 |
} |
305 |
/* (non-Javadoc) |
320 |
/* (non-Javadoc) |
Lines 368-380
Link Here
|
368 |
return provider.getImage(editValue); |
383 |
return provider.getImage(editValue); |
369 |
} |
384 |
} |
370 |
/** |
385 |
/** |
|
|
386 |
* Returns the parent <code>PropertySheetEntry</code> |
387 |
* @return parent |
388 |
*/ |
389 |
protected PropertySheetEntry getParent() { |
390 |
return parent; |
391 |
} |
392 |
/** |
371 |
* Returns an property source for the given object. |
393 |
* Returns an property source for the given object. |
372 |
* |
394 |
* |
373 |
* @param object an object for which to obtain a property source or |
395 |
* @param object an object for which to obtain a property source or |
374 |
* <code>null</code> if a property source is not available |
396 |
* <code>null</code> if a property source is not available |
375 |
* @return an property source for the given object |
397 |
* @return an property source for the given object |
376 |
*/ |
398 |
*/ |
377 |
private IPropertySource getPropertySource(Object object) { |
399 |
protected IPropertySource getPropertySource(Object object) { |
378 |
if (sources.containsKey(object)) |
400 |
if (sources.containsKey(object)) |
379 |
return (IPropertySource)sources.get(object); |
401 |
return (IPropertySource)sources.get(object); |
380 |
|
402 |
|
Lines 404-410
Link Here
|
404 |
* Returns the value objects of this entry. |
426 |
* Returns the value objects of this entry. |
405 |
* @return Object[] |
427 |
* @return Object[] |
406 |
*/ |
428 |
*/ |
407 |
private Object[] getValues() { |
429 |
public Object[] getValues() { |
408 |
return values; |
430 |
return values; |
409 |
} |
431 |
} |
410 |
/* (non-Javadoc) |
432 |
/* (non-Javadoc) |
Lines 440-446
Link Here
|
440 |
List entriesToDispose = new ArrayList(Arrays.asList(childEntries)); |
462 |
List entriesToDispose = new ArrayList(Arrays.asList(childEntries)); |
441 |
|
463 |
|
442 |
// rebuild child entries using old when possible |
464 |
// rebuild child entries using old when possible |
443 |
childEntries = new PropertySheetEntry[descriptors.size()]; |
465 |
childEntries = createChildEntries(descriptors.size()); |
444 |
boolean entriesChanged = descriptors.size() != entryCache.size(); |
466 |
boolean entriesChanged = descriptors.size() != entryCache.size(); |
445 |
for (int i = 0; i < descriptors.size(); i++) { |
467 |
for (int i = 0; i < descriptors.size(); i++) { |
446 |
IPropertyDescriptor d = (IPropertyDescriptor)descriptors.get(i); |
468 |
IPropertyDescriptor d = (IPropertyDescriptor)descriptors.get(i); |
Lines 452-458
Link Here
|
452 |
entriesToDispose.remove(entry); |
474 |
entriesToDispose.remove(entry); |
453 |
} else { |
475 |
} else { |
454 |
// create new entry |
476 |
// create new entry |
455 |
entry = new PropertySheetEntry(); |
477 |
entry = createChildEntry(); |
456 |
entry.setDescriptor(d); |
478 |
entry.setDescriptor(d); |
457 |
entry.setParent(this); |
479 |
entry.setParent(this); |
458 |
entry.setPropertySourceProvider(propertySourceProvider); |
480 |
entry.setPropertySourceProvider(propertySourceProvider); |
Lines 473-479
Link Here
|
473 |
/** |
495 |
/** |
474 |
* Refresh the entry tree from the root down |
496 |
* Refresh the entry tree from the root down |
475 |
*/ |
497 |
*/ |
476 |
private void refreshFromRoot() { |
498 |
protected void refreshFromRoot() { |
477 |
if (parent == null) |
499 |
if (parent == null) |
478 |
refreshChildEntries(); |
500 |
refreshChildEntries(); |
479 |
else |
501 |
else |
Lines 583-589
Link Here
|
583 |
* |
605 |
* |
584 |
* @param newValue the new value |
606 |
* @param newValue the new value |
585 |
*/ |
607 |
*/ |
586 |
private void setValue(Object newValue) { |
608 |
protected void setValue(Object newValue) { |
587 |
// Set the value |
609 |
// Set the value |
588 |
for (int i = 0; i < values.length; i++) { |
610 |
for (int i = 0; i < values.length; i++) { |
589 |
values[i] = newValue; |
611 |
values[i] = newValue; |