Bug 198201 [DataBinding] Provide POJO observables
There have been quite a few requests on the newsgroup recently about trying to use POJOs and filling up logs with error messages about not being able to register property change event listeners. It would be nice to provide a cleaner solution than using the JavaBean support that we provide today.
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/internal/databinding/internal/beans/JavaBeanObservableListTest.java
ListChangeEvent event = listener.event;
		assertEquals(list, event.getObservableList());
		assertEntry(event.diff.getDifferences()[0], true, 0, newElement);
		assertEntry(event.diff.getDifferences()[1], false, 1, oldElement);
	}
	public void testSetPropertyChangeEvent() throws Exception {
		list.add("0");
		assertPropertyChangeEvent(bean, new Runnable() {
			public void run() {
				list.set(0, "1");
			}			
		});
	}
	public void testListChangeEventFiresWhenNewListIsSet() throws Exception {
		List elements = Arrays.asList(new String[] { "1", "2" });
		ListChangeEventTracker listener = new ListChangeEventTracker();
		list.addListChangeListener(listener);
		assertEquals(0, listener.count);
		bean.setList(elements);
		assertEquals(1, listener.count);
	}
	private static void assertEntry(ListDiffEntry entry, boolean addition,
			int position, Object element) {
		assertEquals("addition", addition, entry.isAddition());
		assertEquals("position", position, entry.getPosition());
		assertEquals("element", element, entry.getElement());
	}
	private static void assertPropertyChangeEvent(NonStandardBean bean, Runnable runnable) {
		PropertyChangeTracker listener = new PropertyChangeTracker();
		bean.addPropertyChangeListener(listener);