capint
11/2/2016 - 10:07 AM

Eclipse >> Data binding >> IObservableSet

Eclipse >> Data binding >> IObservableSet

//Obtain an IObservableSet
IObservableSet set = ViatraObservables
		.observeMatchesAsSet(matcher);

//Add change listener to the IObservableSet
set.addSetChangeListener(new ISetChangeListener() {
	@Override
	public void handleSetChange(SetChangeEvent event) {
		for (Object addition : event.diff.getAdditions()) {
			//Processing of addition
		}
		for (Object removal : event.diff.getRemovals()) {
	    //Processing of removal
		}
	}
})