*/
private TransactionalEditingDomain createEditingDomain() {
TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory
.getInstance().createEditingDomain();
editingDomain.setID("OntoUML.diagram.EditingDomain"); //$NON-NLS-1$
final NotificationFilter diagramResourceModifiedFilter = NotificationFilter
.createNotifierFilter(editingDomain.getResourceSet()).and(
NotificationFilter
.createEventTypeFilter(Notification.ADD)).and(
NotificationFilter.createFeatureFilter(
ResourceSet.class,
ResourceSet.RESOURCE_SET__RESOURCES));
editingDomain.getResourceSet().eAdapters().add(new Adapter() {
private Notifier myTarger;
public Notifier getTarget() {
return myTarger;
}
public boolean isAdapterForType(Object type) {
return false;
}
public void notifyChanged(Notification notification) {
if (diagramResourceModifiedFilter.matches(notification)) {
Object value = notification.getNewValue();
if (value instanceof Resource) {
((Resource) value).setTrackingModification(true);
}
}