Bug 257919 [Viewers] OwnerDraw: Open type doesn't display the selected type
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/StyledCellLabelProvider.java
* styles.
	 * 
	 * @param decoratedString the decorated string
	 * @param decorationStyler the styler to use for the decoration or <code>null</code> for no
	 *            styles
	 * @param styledString the original styled string
	 * 
	 * @return the styled decorated string (can be the given <code>styledString</code>)
	 * @since 3.5
	 */
	public static StyledString styleDecoratedString(String decoratedString, Styler decorationStyler, StyledString styledString) {
		String label= styledString.getString();
		int originalStart= decoratedString.indexOf(label);
		if (originalStart == -1) {
			return new StyledString(decoratedString); 
		}
		if (decoratedString.length() == label.length())
			return styledString;
		if (originalStart > 0) {
			StyledString newString= new StyledString(decoratedString.substring(0, originalStart), decorationStyler);
			newString.append(styledString);
			styledString= newString;
		}
		if (decoratedString.length() > originalStart + label.length()) { 
			return styledString.append(decoratedString.substring(originalStart + label.length()), decorationStyler);
		}
		return styledString; 
	}
}