/*
 * Copyright (c) 2004 JetBrains s.r.o. All  Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * -Redistributions of source code must retain the above copyright
 *  notice, this list of conditions and the following disclaimer.
 *
 * -Redistribution in binary form must reproduct the above copyright
 *  notice, this list of conditions and the following disclaimer in
 *  the documentation and/or other materials provided with the distribution.
 *
 * Neither the name of JetBrains or IntelliJ IDEA
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * This software is provided "AS IS," without a warranty of any kind. ALL
 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
 * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
 * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. JETBRAINS AND ITS LICENSORS SHALL NOT
 * BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT
 * OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS
 * DERIVATIVES. IN NO EVENT WILL JETBRAINS OR ITS LICENSORS BE LIABLE FOR ANY LOST
 * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL,
 * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY
 * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN
 * IF JETBRAINS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 *
 */
package com.intellij.ide.highlighter;

import com.intellij.ide.structureView.StructureViewBuilder;
import com.intellij.lang.xhtml.XHTMLLanguage;
import com.intellij.openapi.fileTypes.FileTypeSupportCapabilities;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.intellij.openapi.vfs.VirtualFile;

import javax.swing.*;

public class XHtmlFileType extends LanguageFileType {
  private static final Icon ICON = IconLoader.getIcon("/fileTypes/xhtml.png");

  public XHtmlFileType() {
    super(new XHTMLLanguage());
  }

  public String getName() {
    return "XHTML";
  }

  public String getDescription() {
    return "XHTML files";
  }

  public String getDefaultExtension() {
    return "xhtml";
  }

  public Icon getIcon() {
    return ICON;
  }

  private static FileTypeSupportCapabilities capabilities = new FileTypeSupportCapabilities() {
    public boolean hasCompletion() {
      return true;
    }

    public boolean hasValidation() {
      return true;
    }

    public boolean hasFindUsages() {
      return true;
    }

    public boolean hasNavigation() {
      return true;
    }

    public boolean hasRename() {
      return true;
    }
  };

  public FileTypeSupportCapabilities getSupportCapabilities() {
    return capabilities;
  }

  public StructureViewBuilder getStructureViewBuilder(VirtualFile file, Project project) {
    return null;
  }
}
@@ -1693,24 +1693,225 @@
 iewBuilder;%0A
+import com.intellij.ide.structureView.TreeBasedStructureViewBuilder;%0Aimport com.intellij.ide.structureView.StructureViewModel;%0Aimport com.intellij.ide.structureView.impl.xml.XmlStructureViewTreeModel;%0A
 import com.i
@@ -2201,16 +2201,89 @@
 ualFile;
+%0Aimport com.intellij.psi.xml.XmlFile;%0Aimport com.intellij.psi.PsiManager;
 %0A%0Aimport
@@ -3289,16 +3289,22 @@
 Builder(
+final 
 VirtualF
@@ -3312,16 +3312,22 @@
 le file,
+ final
  Project
@@ -3354,11 +3354,222 @@
 rn n
-ull
+ew TreeBasedStructureViewBuilder() %7B%0A      public StructureViewModel createStructureViewModel() %7B%0A        return new XmlStructureViewTreeModel((XmlFile)PsiManager.getInstance(project).findFile(file));%0A      %7D%0A    %7D
 ;%0A  

structure view as in html file type