Bug 137877 [DataBinding] StructuredViewerObservableValue javadoc and code cleanup
I started looking at this class to see what it was doing and noticed a potential problem if anyone was to extend this class and this snowballed into adding javadoc, cleaning up the code a bit, and writing tests. Changes made: * documented doGetValue() and the constructor to warn of subclassing issues. see explanation below... * changed doGetValue() from public to protected. I'm assuming since this is a template method it is only meant for the eyes of subclasses and other package classes. * removed the 'attribute' parameter from the constructor because the constructor wouldn't allow but one value for attribute and would throw an IAE if it wasn't correct. Every method was then checking this variable for the same value and because it was only set at construction and only one value was allowed it seemed redundant. * removed 'attribute' from the class and from every method because of the removal of it from the constructor. * added validation for constructor parameters doGetValue() is public and if someone was to extend this class and override doGetValue() this method would get invoked before their subclass was fully initialized because their constructor would not have ran yet. Because this class extends from AbstractObservableValue and doGetValue() is declared as protected it didn't seem like much could be done about changing this so I ended up documenting it thoroughly in the constructor javadoc and the javadoc for doGetValue(). The constructor signature change and the validation the constructor parameter are both nonpassive changes. I also was wanting to rename the class to StructuredViewerSingleSelectionObservableValue but didn't do so in order to be able to provide a patch that allowed for the easy viewing of the changes made. Because of the constructor change I had to change ViewersObservableFactory as well when constructing the object.
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/viewers/ViewersObservableFactory.java
* property description's object and property ID:
 * <ul>
 * <li>object instanceof StructuredViewer, property ID is
 * ViewersProperties.SINGLE_SELECTION - denoting the viewer's (single) selection</li>
 * <li>object instanceof TableViewer, property ID is ViewersProperties.CONTENT</li>
 * <li>object instanceof AbstractListViewer, property ID is
 * ViewersProperties.CONTENT</li>
 * </ul>
 * </li>
 * </ul>
 * TODO complete the list
 * 
 * @since 1.0
 * 
 */
final public class ViewersObservableFactory implements IObservableFactory {
	/**
	 * Create a factory that can create udatables for JFace viewers
	 */
	public ViewersObservableFactory() {
	}
	/**
	 * @param updateTime.
	 *            Update policy of DataBindingContext.TIME_EARLY or TIME_LATE.
	 *            This is only a hint that some editable viewers may support
	 */
	public ViewersObservableFactory(int updateTime) {
	}
	public IObservable createObservable(Object description) {
		if (description instanceof Property) {