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
return ((IColorProvider) provider).getBackground(element);
		return null;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
	 */
	public Font getFont(Object element) {
		if(provider instanceof IFontProvider)
			return ((IFontProvider) provider).getFont(element);
		return null;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
	 */
	public Color getForeground(Object element) {
		if(provider instanceof IColorProvider)
			return ((IColorProvider) provider).getForeground(element);
		return null;
	}
	/* (non-Javadoc)
	 * @see org.eclipse.jface.viewers.ILabelUpdateProcessor#processUpdates(java.lang.Object, org.eclipse.jface.viewers.ILabelUpdateValidator)
	 */
	public void processUpdates(Object element, ILabelUpdateValidator validator) {
		if(validator.shouldUpdate(element) == UPDATE_LABEL)
			fireLabelProviderChanged(new LabelProviderChangedEvent(this,element));
	}
}