{
      Object object = ((IStructuredSelection)selection).getFirstElement();
      if (object instanceof IFile)
      {
        file = (IFile)object;

        action.setEnabled
          (action.getId().indexOf("XML") != -1 ||
             Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey
               (file.getFullPath().getFileExtension()));
        return;
      }
    }