[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.emf] Re: search marker pops up resource changed dialog

Daniel,

There is generated code in the editor that does this:

public boolean visit(IResourceDelta delta)
{
  if (delta.getResource().getType() == IResource.FILE)
  {
    if ((delta.getKind() & (IResourceDelta.CHANGED | IResourceDelta.REMOVED)) != 0)
    {
      Resource resource = resourceSet.getResource(URI.createURI(delta.getFullPath().toString()), false);
      if (resource != null)
      {
        if ((delta.getKind() & IResourceDelta.REMOVED) != 0)
        {
          removedResources.add(resource);
        }
        else
        {
          changedResources.add(resource);
        }
      }
    }
  }

  return true;
}

I suppose that adding a marker is considered a change by this algorithm and I'm not sure how to detect that it's only the addition of a marker.  If you figure that out, we could change our template to ignore marker changes...
 

Daniel Hirscher wrote:

Hi,

my scenario is:
- open my EMF Editor
- change something, so that the editor gets dirty
- do a FileSearch on some text from this Editor
    so that I get at least one result
- open another (any) editor
- activate my EMF Editor again

then, I get a dialog telling me the resource has changed.
This is not a bug, there was a marker added to the resource.

But I don't want that dialog. The dialog is ok, if the contents
of the file changes, but not when adding a search marker.

What can I do to prevent the dialog when adding markers?