* (non-Javadoc)
*
* @see org.eclipse.ui.internal.progress.AbstractProgressViewer#add(java.lang.Object[])
*/
public void add(Object[] elements) {
ViewerComparator sorter = getComparator();
ArrayList newItems = new ArrayList(control.getChildren().length
+ elements.length);
Control[] existingChildren = control.getChildren();
for (int i = 0; i < existingChildren.length; i++) {
newItems.add(existingChildren[i].getData());
}
for (int i = 0; i < elements.length; i++) {
newItems.add(elements[i]);
}
JobTreeElement[] infos = new JobTreeElement[newItems.size()];
newItems.toArray(infos);
if (sorter != null) {
sorter.sort(this, infos);
}
// Update with the new elements to prevent flash
for (int i = 0; i < existingChildren.length; i++) {
((ProgressInfoItem) existingChildren[i]).dispose();