private ISeamProperty findSeamProperty(IFile file, int start, int end) {
    if (file == null) return null;
    IProject project = file.getProject();
    if (project == null) return null;

    ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
    if (seamProject == null) return null;

    Set<ISeamComponent> components = seamProject.getComponentsByPath(file.getFullPath());
    for (ISeamComponent component : components) {
      Set<ISeamXmlComponentDeclaration> declarations = component.getXmlDeclarations();
      for (ISeamXmlComponentDeclaration declaration : declarations) {
        Collection<ISeamProperty> properties = declaration.getProperties();
        for (ISeamProperty property : properties) {
          ITextSourceReference location =
              property.getLocationFor(ISeamXmlComponentDeclaration.NAME);

          if (location.getStartPosition() <= start
              && (location.getStartPosition() + location.getLength()) >= end) return property;
        }
      }
    }

    return null;
  }