Bug 4584 - [PropertiesView] property sheet label provider has limited ability (1G5JKHG)
Summary: [PropertiesView] property sheet label provider has limited ability (1G5JKHG)
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 98
: P4 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2001-10-11 14:19 EDT by Greg Adams CLA
Modified: 2009-08-30 02:09 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Adams CLA 2001-10-11 14:19:23 EDT
Seems like the PropertySheet's Lable Providers
have very limited functionality. For example -
we are not able to change the color or font of a property value.
We need to have visual distinction between read-only
properties and the writeable ones. For example we woud like
the read-only properties to be grayed(like disabled).
In order to do that I have implemented our own
LabelProvider, which derives from SimpleLabelProvider.
This class has the following methods:

 getLabelImage(IVisualPart, Object);
 getLabelText(IVisualPart, Object);

So, I was hoping that the VisualPart argument is actually
the table item/widget itself and I'll be able to change
it's appearance(for example it's color or font).

Unfortunately the PropertySheetViewer when updates the table
items, passes as first argument reference to itself instead to the TreeItem:
Follows excerpt from the PropertySheet code:

/*PropertySheetViewer  method*/
private void updateValue(TableTreeItem item)
{
   ...
   provider = getLabelProvider();

   String label = provider.getLabelText(this, entry);
   IImage image = provider.getLabelImage(this, entry);
   ....
}

But even if the PropertySheetViewer was passing the
TableTreeItem as first argument, that still wouldn't work,
because TableTreeItem doesn't have the needed functionality.

So, is there anything else we could do to change the color
or the font of a PropertySheet item's text?


NOTES:

GDA (12/6/00 10:37:42 AM)
	Please be clear in answering this to differentiate between
		- tech preview
		- current code base

RG (12/7/00 5:19:29 PM)
	As stated above there is no way to do this since it is not supported by 
SWT.
	If this were considered important and SWT implemented the functionality 
	then we could find a way to provide this in the property sheet.


VI (1/13/01 9:59:57 PM)
From what I can tell, they would like to be able to set the Color and/or Font 
of a single item in a TableTree.  
Correct me if I am wrong.
This is not available in the TableTree because it is not available in the Table 
(TableTree is just cake for a Table).  
This functionality is not available on the Table because Windows does not 
provide the API to do this. (I am 90% 
sure that this last statement is true and I will verify with Steve when he gets 
in).
I think this would require something like Owner Draw or implementing our own 
widget - both answers are a lot of work.

KH (1/15/2001 8:56:51 PM)

	Moving to SWT for consideration.

GDA (1/29/01 9:21:23 PM)
The information is:
	This is definitely an important functionality for us in the properties 
view.  
	Without this, the user cannot tell which properties are writeable, and 
which are read-only.
 
	If we cannot make this happen we need to let them know.

VI (31/01/2001 2:20:03 PM)
	What is required to fix this PR is to write our own TableTree widget 
(not use the native Table widget).

	This can be considered under the Custom Widget work but it clearly is 
going to require a bit of time 
	and needs to be prioritized relative to the other CustomWidgets.

SN (2/5/01 3:48:58 PM)
	Can be addressed by a Custom Widget.
Comment 1 Randy Hudson CLA 2002-02-26 10:58:38 EST
There should be a guideline for the PropertySheet.  In the past, gray text on 
the **Value** indicated that multiple objects were selected, all for which that 
property existed, but that their values were different.  You could still edit 
the value.

To indicate that you cannot edit the property, I would suggest gray text for 
the property label, not the value.  What if I had a read-only 
property "background color", for which the current value was black.  I wrote a 
custom renderer that paints a black rectangle.  The value column needs to be 
reserved for rendering the value, not indicating CellEditor enabled state.
Comment 2 Mike Wilson CLA 2002-05-23 16:09:37 EDT
Since all this PR was asking for was a way to set  "the color or the font" on 
a per row basis, and since we have provided the ability to set both the 
foreground and background color or R2.0, I am marking this PR as fixed.
Comment 3 Randy Hudson CLA 2002-05-23 17:00:15 EDT
Has Color getLabelForeground(Object) been added to LabelProvider?
What about getLabelForeground(Object[]) since the property sheet is really 
displaying the value of multiple objects.

I recommend that a gray *background* be used to represent read-only properties, 
since this best matches a disabled Text control.  GA was suggesting a gray 
foreground.

Gray foreground should be used to indicate multiple selection where the values 
are not all the same.  The API must be changed so that the fact that the values 
are different can be detected.

Please move to UI component.
Comment 4 Mike Wilson CLA 2002-05-23 17:39:12 EDT
Agree that this needs to be surfaced above the SWT level. Moving to UI.
Comment 5 Eric Moffatt CLA 2006-06-23 15:27:18 EDT
Cleaning up defect lists by setting ones without recent traffic to 'REMIND'.
Comment 6 Denis Roy CLA 2009-08-30 02:09:23 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.