Bug 213166 [Viewers] Problems with OwnerDrawLabelProvider.setUpOwnerDraw
3.4 M4 To set up the owner draw callbacks for a viewer OwnerDrawLabelProvider.setUpOwnerDraw is offered. The problem of this is: a. there's no way to uninstall the callbacks. In our views we want to allow to enable and disable owner draw in the preferences b. from an API client perspective, it would be nicer if the label provider could install itself when installed. A good solution would be to add more life cycle to a label provider. CellLabelProvider.initialize(ColumnViewer, int column) There's already ILableProvider.dispose when a label provider is removed from a viewer.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/ContentViewer.java
* This viewer's label provider listener.
     * Note: Having a viewer register a label provider listener with
     * a label provider avoids having to define public methods
     * for internal events.
     */
    private final ILabelProviderListener labelProviderListener = new ILabelProviderListener() {
        public void labelProviderChanged(LabelProviderChangedEvent event) {
            ContentViewer.this.handleLabelProviderChanged(event);
        }
    };
    /**
     * Creates a content viewer with no input, no content provider, and a
     * default label provider.
     */
    protected ContentViewer() {
    }
    /**
     * Returns the content provider used by this viewer, 
     * or <code>null</code> if this view does not yet have a content
     * provider.
     * <p>
     * The <code>ContentViewer</code> implementation of this method returns the content
     * provider recorded is an internal state variable. 
     * Overriding this method is generally not required; 
     * however, if overriding in a subclass, 
     * <code>super.getContentProvider</code> must be invoked.
     * </p>
     *
     * @return the content provider, or <code>null</code> if none
     */