Bug 91749 - [PropertiesView] PropertySheetViewer needs custom rendering support
Summary: [PropertiesView] PropertySheetViewer needs custom rendering support
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-18 11:28 EDT by John Ruud CLA
Modified: 2019-09-06 16:15 EDT (History)
0 users

See Also:


Attachments
proposed patch to org.eclipse.ui.views plugin (1.20 KB, patch)
2005-04-18 11:30 EDT, John Ruud CLA
no flags Details | Diff
example plugin (4.54 KB, application/x-zip-compressed)
2005-04-18 11:31 EDT, John Ruud CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Ruud CLA 2005-04-18 11:28:07 EDT
In our product based on the Eclipse platform we need to customize the text, 
icons, fonts, and colors displayed in *both* columns of the properties view, 
but this is currently not supported by the PS. In addition we need to consider 
the property’s parent in order to properly render some of the properties. 

We therefore modified the PropertySheetViewer to delegate the rendering of the 
PS entries to a pluggable ‘widget renderer’, so that users with special needs 
are free to control the rendering of the (tree item) widget.

We added the following interface:
public interface IWidgetRenderer {
	public void render(Widget widget, Object info);
}

and modified PropertySheetViewer.updateEntry to conditionally invoke the 
renderer:
private void updateEntry(IPropertySheetEntry entry, TreeItem item) {
        // ensure that backpointer is correct
        item.setData(entry);

        if (entry instanceof IWidgetRenderer)
            ((IWidgetRenderer) entry).render(item, entry);
        else {
            // update the name and value columns
            item.setText(0, entry.getDisplayName());
            item.setText(1, entry.getValueAsString());
            Image image = entry.getImage();
            if (item.getImage(1) != image)
                item.setImage(1, image);
        }

        // update the "+" icon
        updatePlus(entry, item);
    }

Even though only very minor modifications were made to the 
org.eclipse.ui.views plugin, we need to clone the plugin every time the 
Eclipse platform is updated (and this is becoming a maintenance issue). It 
would be of *great* help to us if this (or similar capabilities) could be 
included in 3.1. This simple implementation shouldn’t break any existing code 
or APIs.
 
I have included a patch to the org.eclipse.ui.views plugin, and an example 
plugin that can be run by importing the widgetrenderer.test plugin into the 
workspace and then launching a runtime workspace. Create a file with the 
extension ‘tst’ (e.g. ‘test.tst’), and open the PS view in order to see how 
the editor’s properties are rendered differently.

John
Comment 1 John Ruud CLA 2005-04-18 11:30:08 EDT
Created attachment 20002 [details]
proposed patch to org.eclipse.ui.views plugin
Comment 2 John Ruud CLA 2005-04-18 11:31:23 EDT
Created attachment 20003 [details]
example plugin
Comment 3 Nick Edgar CLA 2005-07-05 15:21:37 EDT
See also bug 4584.
Comment 4 John Ruud CLA 2006-05-17 19:57:30 EDT
It is probably way too late to get anything included in time for the 3.2 release, but I was hoping it would be possible to open up the viewer for extensions ever so slightly, until a more "formal" extension mechanism may be agreed upon.

The quick work-around would be for the PropertySheetViewer class to change from 'private' to 'public', and the updateEntry() and updatePlus() methods from 'private' to 'protected'. This would allow us to subclass just the viewer, instead of having to clone & maintain our own version of the complete org.eclipse.ui.views plugin (due to the viewer accessing other private org.eclipse.ui.views classes etc.). Would it be possible to "fast-track" this (simple) change request, so that it may make it in time for 3.2?

Thanks, John
Comment 5 Eric Moffatt CLA 2006-05-19 14:18:12 EDT
John, sorry but we're in 'lock down' mode for 3.2. Also, this is an API change which is something that we just don't do 'ad hoc' because, once published, we have to live with it forever.

We'll have to come back to this post-3.2. Do you have any suggestions as what you'd like to see in a more 'formal' extension mechanism?
Comment 6 John Ruud CLA 2006-05-23 16:08:08 EDT
Eric, the patch I attached earlier is an example of what I meant by a 'formal' extension mechanism (making the viewer class public etc. would be a quicker fix)
Comment 7 Chris White CLA 2006-08-13 16:24:50 EDT
The approach outlined in comment#4 would work for us as well (or the IWidgetRenderer approach). We could really use this feature. Is there any problem applying the proposed patch in 3.3?
Comment 8 Eric Moffatt CLA 2006-08-14 14:50:10 EDT
I'll see if this causes worries but it seems reasonable to me...
Comment 9 John Ruud CLA 2006-12-18 17:25:04 EST
Since Eclipse 3.3 is now in milestone 4, I was wondering if it would be possible to apply the method visibility changes (private -> protected) described in comment #4? There's probably still time to consider making more extensive changes as well, but I would very much like to avoid what happened before the last major release (when even simple changes couldn't be applied since the platform was in lock-down status)

Comment 10 Eric Moffatt CLA 2007-03-29 09:08:13 EDT
John, I apologize for letting this slip off my radar. The new Min/Max behavior has taken over my life...
Comment 11 John Ruud CLA 2007-03-29 14:23:31 EDT
Eric, would it still be possible to include the (very simple) changes proposed in comment #9 to the 3.3 stream?
Comment 12 Boris Bokowski CLA 2009-06-12 13:00:54 EDT
(mass update)
Removing target milestone, this bug was targeted at a milestone in the past.
Comment 13 Eclipse Webmaster CLA 2019-09-06 16:15:10 EDT
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.