Java 类org.eclipse.xtext.resource.IResourceDescription.Event 实例源码

项目:dsl-devkit    文件:CachingStateBasedContainerManager.java   
CacheInvalidator(final IResourceDescriptions resourceDescriptions, final String handle, final IContainerState containerState) {
  this.resourceDescriptions = resourceDescriptions;
  this.handle = handle;
  this.containerState = containerState;
  if (resourceDescriptions instanceof IResourceDescription.Event.Source) {
    ((IResourceDescription.Event.Source) resourceDescriptions).addListener(this);
  }
}
项目:n4js    文件:TestEventListener.java   
@Override
public void descriptionsChanged(Event event) {
    URI expectedURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
    for (IResourceDescription.Delta delta : event.getDeltas()) {
        URI deltaURI = delta.getUri();
        if (expectedURI.equals(deltaURI)) {
            eventFired = true;
        }
    }
}
项目:n4js    文件:N4JSDirtyStateEditorSupport.java   
@Override
public void scheduleUpdateEditorJob(final IResourceDescription.Event event) {
    N4JSUpdateEditorStateJob job = updateEditorStateJob;
    if (job == null) {
        job = createUpdateEditorJob();
        updateEditorStateJob = job;
    }
    job.scheduleFor(event);
}
项目:n4js    文件:N4JSDirtyStateEditorSupport.java   
private Set<URI> collectDeltaURIs(Event event) {
    Set<URI> deltaURIs = Sets.newHashSet();
    for (IResourceDescription.Delta delta : event.getDeltas()) {
        deltaURIs.add(delta.getUri());
    }
    return deltaURIs;
}
项目:dsl-devkit    文件:CachingStateBasedContainerManager.java   
/** {@inheritDoc} */
@Override
public void descriptionsChanged(final Event event) {
  for (Delta d : event.getDeltas()) {
    if (containerState.contains(d.getUri())) {
      discardCachedContainer(resourceDescriptions, handle);
      if (resourceDescriptions instanceof IResourceDescription.Event.Source) {
        ((IResourceDescription.Event.Source) resourceDescriptions).removeListener(this);
      }
      break;
    }
  }
}
项目:dsl-devkit    文件:FastReferenceSearchResultContentProvider.java   
@Inject
public FastReferenceSearchResultContentProvider(final IResourceDescriptions resourceDescriptions) {
  super(resourceDescriptions);
  this.resourceDescriptions = resourceDescriptions;
  if (resourceDescriptions instanceof IResourceDescription.Event.Source) {
    ((IResourceDescription.Event.Source) resourceDescriptions).addListener(this);
  }
}
项目:bts    文件:ReferenceSearchResultContentProvider.java   
@Inject
public ReferenceSearchResultContentProvider(IResourceDescriptions resourceDescriptions) {
    batchedSearchResultEvents = Lists.newArrayList();
    this.resourceDescriptions = resourceDescriptions;
    if (resourceDescriptions instanceof IResourceDescription.Event.Source) {
        ((IResourceDescription.Event.Source) resourceDescriptions).addListener(this);
    }
}
项目:n4js    文件:AbstractBuilderTest.java   
@Override
public void descriptionsChanged(Event event) {
    this.events.add(event);
}
项目:n4js    文件:AbstractBuilderTest.java   
/***/
public List<Event> getEvents() {
    return events;
}
项目:n4js    文件:N4JSDirtyStateEditorSupport.java   
@Override
protected void scheduleFor(IResourceDescription.Event event) {
    super.scheduleFor(event);
}
项目:n4js    文件:N4JSDirtyStateEditorSupport.java   
@Override
protected Collection<Resource> collectAffectedResources(XtextResource resource, Event event) {
    List<Resource> result = doCollectAffectedResources(resource, event);
    markResourcesAsLoaded(result);
    return result;
}
项目:n4js    文件:N4JSDirtyStateEditorSupport.java   
private List<Resource> doCollectAffectedResources(XtextResource resource, Event event) {
    Set<URI> deltaURIs = collectDeltaURIs(event);
    List<Resource> result = collectTransitivelyDependentResources(resource, deltaURIs);
    return result;
}
项目:xtext-core    文件:DelegatingEventSource.java   
public DelegatingEventSource(IResourceDescription.Event.Source source) {
    this.source = source;
}
项目:xtext-core    文件:DelegatingEventSource.java   
@Override
public void descriptionsChanged(Event event) {
    notifyListeners(event);
}
项目:dsl-devkit    文件:FastReferenceSearchResultContentProvider.java   
@Override
public void descriptionsChanged(final Event event) {
  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
    @Override
    public void run() {
      for (Delta delta : event.getDeltas()) {
        if (!(delta.getNew() instanceof StatefulResourceDescription)) {
          for (Iterator<ReferenceSearchViewTreeNode> i = rootNodes.values().iterator(); i.hasNext();) {
            ReferenceSearchViewTreeNode rootNode = i.next();
            if (((IResourceDescription) rootNode.getDescription()).getURI().equals(delta.getUri())) {
              if (delta.getNew() == null) {
                i.remove();
                viewer.remove(rootNode);
                break;
              } else {
                Iterable<IReferenceDescription> newReferenceDescriptions = delta.getNew().getReferenceDescriptions();
                List<ReferenceSearchViewTreeNode> removedReferenceNodes = Lists.newArrayList();
                for (ReferenceSearchViewTreeNode referenceNode : rootNode.getChildren()) {
                  final URI referenceSourceURI = ((IReferenceDescription) referenceNode.getDescription()).getSourceEObjectUri();
                  if (!Iterables.any(newReferenceDescriptions, new Predicate<IReferenceDescription>() {
                    @Override
                    public boolean apply(final IReferenceDescription input) {
                      return input.getSourceEObjectUri().equals(referenceSourceURI);
                    }
                  })) {
                    removedReferenceNodes.add(referenceNode);
                  }
                }
                for (ReferenceSearchViewTreeNode removedReferenceNode : removedReferenceNodes) {
                  rootNode.removeChild(removedReferenceNode);
                }
                if (rootNode.getChildren().isEmpty()) {
                  i.remove();
                  viewer.remove(rootNode);
                  break;
                } else {
                  viewer.remove(rootNode, Iterables.toArray(removedReferenceNodes, ReferenceSearchViewTreeNode.class));
                }
              }
            }
          }
        }
      }
    }
  });
}
项目:bts    文件:ReferenceSearchResultContentProvider.java   
public void descriptionsChanged(final Event event) {
    Display.getDefault().asyncExec(new Runnable() {
        public void run() {
            if (rootNodes != null) {
                for (Delta delta : event.getDeltas()) {
                    if (!(delta.getNew() instanceof StatefulResourceDescription)) {
                        for (Iterator<ReferenceSearchViewTreeNode> i = rootNodes.iterator(); i.hasNext();) {
                            ReferenceSearchViewTreeNode rootNode = i.next();
                            if (((IResourceDescription) rootNode.getDescription()).getURI().equals(delta.getUri())) {
                                if (delta.getNew() == null) {
                                    i.remove();
                                    viewer.remove(rootNode);
                                    break;
                                } else {
                                    Iterable<IReferenceDescription> newReferenceDescriptions = delta.getNew()
                                            .getReferenceDescriptions();
                                    List<ReferenceSearchViewTreeNode> removedReferenceNodes = Lists.newArrayList();
                                    for (ReferenceSearchViewTreeNode referenceNode : rootNode.getChildren()) {
                                        final URI referenceSourceURI = ((IReferenceDescription) referenceNode
                                                .getDescription()).getSourceEObjectUri();
                                        if (!Iterables.any(newReferenceDescriptions,
                                                new Predicate<IReferenceDescription>() {
                                                    public boolean apply(IReferenceDescription input) {
                                                        return input.getSourceEObjectUri().equals(
                                                                referenceSourceURI);
                                                    }
                                                })) {
                                            removedReferenceNodes.add(referenceNode);
                                        }
                                    }
                                    for (ReferenceSearchViewTreeNode removedReferenceNode : removedReferenceNodes) {
                                        rootNode.removeChild(removedReferenceNode);
                                    }
                                    if (rootNode.getChildren().isEmpty()) {
                                        i.remove();
                                        viewer.remove(rootNode);
                                        break;
                                    } else {
                                        viewer.remove(rootNode, Iterables.toArray(removedReferenceNodes,
                                                ReferenceSearchViewTreeNode.class));
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    });
}