Bug 121623 [Decorators] Patch to support logical model decoration
In order to properly support the decoration of logical model elements with repository state, we need to have a tighter coupling of the sync decoration (i.e. the > prefix) and the viewer showing the model. This is not overly complex but we must maintain backwards compatibility. To do this, we need a way for a viewer (via it's label provider) to say that it will handle the sync decoration. If the label provider handles sync decoration, the lightweight decorator should not. If the label provider does not, the lightweight decorator shoudl still do the decoration. To support this, I have modifed JFace and Wokbench to pass a decoration context from the decorating label provider through to the lightweight decorators. I will attach what I have done so far for comment.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/DecoratingLabelProvider.java
* @param listener a label provider listener
     */
    public void removeListener(ILabelProviderListener listener) {
        super.removeListener(listener);
        provider.removeListener(listener);
        if (decorator != null) {
            decorator.removeListener(listener);
        }
        listeners.remove(listener);
    }
    /**
     * Sets the label decorator.
     * Removes all known listeners from the old decorator, and adds all known listeners to the new decorator.
     * The old decorator is not disposed.
     * Fires a label provider changed event indicating that all labels should be updated.
     * Has no effect if the given decorator is identical to the current one.
     *
     * @param decorator the label decorator, or <code>null</code> if no decorations are to be applied
     */
    public void setLabelDecorator(ILabelDecorator decorator) {
        ILabelDecorator oldDecorator = this.decorator;
        if (oldDecorator != decorator) {
            Object[] listenerList = this.listeners.getListeners();
            if (oldDecorator != null) {
                for (int i = 0; i < listenerList.length; ++i) {
                    oldDecorator
                            .removeListener((ILabelProviderListener) listenerList[i]);
                }
            }
            this.decorator = decorator;