Bug 228864 - Remote Environment View hasn't icon for target element
Summary: Remote Environment View hasn't icon for target element
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: Remote Tools (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.0.1   Edit
Assignee: Daniel Felix Ferber CLA
QA Contact: Greg Watson CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-25 08:17 EDT by Hongchang Lin CLA
Modified: 2008-09-10 09:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.