Bug 228864

Summary: Remote Environment View hasn't icon for target element
Product: [Tools] PTP Reporter: Hongchang Lin <linhongc>
Component: Remote ToolsAssignee: Daniel Felix Ferber <dfferber>
Status: RESOLVED FIXED QA Contact: Greg Watson <g.watson>
Severity: normal    
Priority: P3 CC: liangqi
Version: 2.0   
Target Milestone: 2.0.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Hongchang Lin CLA 2008-04-25 08:17:55 EDT
Create a target element from the Generic Host target type, there is no icon displayed for the new created tree node in Remote Environment View.
Comment 1 Hongchang Lin CLA 2008-08-25 07:00:02 EDT
I investigated this bug and found that TableTreeItem doesn't allow user to set image on first column, as the following codes indicates:

public void setImage (int index, Image image) {
	checkWidget();
	int columnCount = Math.max(parent.getTable().getColumnCount(), 1);
        if (index <= 0 || index >= columnCount) return;
	if (images.length < columnCount) {
		Image[] newImages = new Image[columnCount];
		System.arraycopy(images, 0, newImages, 0, images.length);
		images = newImages;
	}
	images[index] = image;
	if (tableItem != null) tableItem.setImage(index, image);
}

I guess the reason is that TableTreeView reserves the first column to display the expand/collapse (+/-) icons.

I suggest to use the TreeViewer instead of TableTreeViewer, the advantages are:
1. The TableTreeViewer is deprecated
2. TreeViewer can display hierarchy relationship, and display icon for the first column.
3. Replacing the TableTreeViewer with TreeViewer, will not bring many changes and  cause regression defects. 
Comment 2 Daniel Felix Ferber CLA 2008-09-10 09:51:49 EDT
Added icon that has been suggested on bug #225269.