Examples of NotificationFilter


Examples of org.eclipse.emf.transaction.NotificationFilter

   */
  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);
          }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.