| Summary: | [PropertiesView] LabelProvider#getText() is never called when element is null in PropertySheetEntry | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Maksym Bykovskyy <bykovskyy.maksym> | ||||
| Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | minor | ||||||
| Priority: | P3 | CC: | bykovskyy.maksym, remy.suen | ||||
| Version: | 3.6 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows Vista | ||||||
| Whiteboard: | stalebug | ||||||
| Attachments: |
|
||||||
Created attachment 174587 [details]
Patch for property sheet entry
I'm attaching a patch to this issue. It simply gets the value from provider.getText() when provider is not null. Otherwise, it explicitly returns an empty string when editValue is null.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Build Identifier: 20100617-1415 This is not a bug but rather an implementation choice. I use the Properties view in my RCP and I have some properties with null values. For example when background color (RGB) is null it means its transparent. I want to be able to display text "Transparent" instead of having an empty cell. I looked at PropertySheetEntry#getValueAsString() code and noticed that when value is null it explicitly returns an empty string instead of asking a client what they want to do with it. I think it would much butter to let the user decide what they want their label to look like. "unknown", "n/a", "null", "---", "" etc. When getText() returns null then fair enought you can explicitely set an empty string. Here the code from PropertySheetEntry: public String getValueAsString() { if (editValue == null) { return "";//$NON-NLS-1$ } ILabelProvider provider = descriptor.getLabelProvider(); if (provider == null) { return editValue.toString(); } String text = provider.getText(editValue); if (text == null) { return "";//$NON-NLS-1$ } return text; } Reproducible: Always Steps to Reproduce: 1. Create Properties view. 2. Set property source label provider. 3. Set the property value to null.