com.intellij.openapi.vfs.VirtualFilecom.intellij.psi.FileViewProvider



Project JetBrains/intellij-community in file ...edApi.src.com.intellij.extapi.psi.PsiFileBase.java (2005-12-26)
@@ -7,8 +7,8 @@ import com.intellij.lang.impl.PsiBuilderImpl;
 import com.intellij.lexer.Lexer;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElementVisitor;
+import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.impl.source.PsiFileImpl;
 import com.intellij.psi.impl.source.tree.FileElement;
 import com.intellij.psi.tree.IElementType;
@@ -28,18 +28,8 @@ public abstract class PsiFileBase extends PsiFileImpl {
                                                                            Language.ANY); // Shouldn't happen to be used.
   @NotNull private final Language myLanguage;
 
-  protected PsiFileBase(Project project,
-                        VirtualFile file,
-                        final Language language) {
-    super(project, language.getParserDefinition().getFileNodeType(), FILE_TEXT_CHAMELEON, file);
-    myLanguage = language;
-  }
-
-  protected PsiFileBase(Project project,
-                        String name,
-                        CharSequence text,
-                        final Language language) {
-    super(project, _createFileElement(text, language, project), language.getParserDefinition().getFileNodeType(), FILE_TEXT_CHAMELEON, name);
+  protected PsiFileBase(FileViewProvider viewProvider, final Language language) {
+    super(language.getParserDefinition().getFileNodeType(), FILE_TEXT_CHAMELEON, viewProvider);
     myLanguage = language;
   }
 
Project JetBrains/intellij-community in file ...penapi.src.com.intellij.lang.ParserDefinition.java (2005-12-26)
@@ -17,9 +17,9 @@ package com.intellij.lang;
 
 import com.intellij.lexer.Lexer;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
+import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.tree.IFileElementType;
 import com.intellij.psi.tree.TokenSet;
 import org.jetbrains.annotations.NotNull;
@@ -92,19 +92,9 @@ public interface ParserDefinition {
   /**
    * Creates a PSI element for the specified virtual file.
    *
-   * @param project the project to which the file belongs.
-   * @param file    the file for which the PSI element is created.
+   * @param viewProvider
    * @return the PSI file element.
    */
-  PsiFile createFile(Project project, VirtualFile file);
+  PsiFile createFile(FileViewProvider viewProvider);
 
-  /**
-   * Creates a PSI element for the file with the specified name and contents.
-   *
-   * @param project the project to which the file belongs.
-   * @param name    The name of the file.
-   * @param text    The contents of the file.
-   * @return the PSI file element.
-   */
-  PsiFile createFile(Project project, String name, CharSequence text);
 }
Project JetBrains/intellij-community in file ...properties.parsing.PropertiesParserDefinition.java (2005-12-26)
@@ -10,9 +10,9 @@ import com.intellij.lang.properties.psi.impl.PropertyImpl;
 import com.intellij.lexer.Lexer;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
+import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.tree.TokenSet;
 import com.intellij.psi.tree.IFileElementType;
@@ -52,12 +52,8 @@ public class PropertiesParserDefinition implements ParserDefinition {
     return new PropertiesParser();
   }
 
-  public PsiFile createFile(final Project project, VirtualFile file) {
-    return new PropertiesFileImpl(project, file);
-  }
-
-  public PsiFile createFile(final Project project, String name, CharSequence text) {
-    return new PropertiesFileImpl(project, name, text);
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new PropertiesFileImpl(viewProvider);
   }
 
   @NotNull
Project JetBrains/intellij-community in file ...e.com.intellij.lang.html.HTMLParserDefinition.java (2005-12-26)
@@ -5,11 +5,10 @@ import com.intellij.lang.ParserDefinition;
 import com.intellij.lang.PsiParser;
 import com.intellij.lexer.HtmlLexer;
 import com.intellij.lexer.Lexer;
-import com.intellij.openapi.fileTypes.StdFileTypes;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
+import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.impl.source.html.HtmlFileImpl;
 import com.intellij.psi.tree.IFileElementType;
@@ -55,11 +54,8 @@ public class HTMLParserDefinition implements ParserDefinition {
     return PsiUtil.NULL_PSI_ELEMENT;
   }
 
-  public PsiFile createFile(final Project project, VirtualFile file) {
-    return new HtmlFileImpl(project, file);
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new HtmlFileImpl(viewProvider);
   }
 
-  public PsiFile createFile(final Project project, String name, CharSequence text) {
-    return new HtmlFileImpl(project, name, text, StdFileTypes.HTML);
-  }
 }
Project JetBrains/intellij-community in file ...rce.com.intellij.lang.xml.XMLParserDefinition.java (2005-12-26)
@@ -4,11 +4,10 @@ import com.intellij.lang.ASTNode;
 import com.intellij.lang.ParserDefinition;
 import com.intellij.lang.PsiParser;
 import com.intellij.lexer.Lexer;
-import com.intellij.openapi.fileTypes.StdFileTypes;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
+import com.intellij.psi.FileViewProvider;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.impl.source.xml.XmlFileImpl;
 import com.intellij.psi.tree.IFileElementType;
@@ -54,11 +53,8 @@ public class XMLParserDefinition implements ParserDefinition {
     return PsiUtil.NULL_PSI_ELEMENT;
   }
 
-  public PsiFile createFile(final Project project, VirtualFile file) {
-    return new XmlFileImpl(project, file);
+  public PsiFile createFile(FileViewProvider viewProvider) {
+    return new XmlFileImpl(viewProvider);
   }
 
-  public PsiFile createFile(final Project project, String name, CharSequence text) {
-    return new XmlFileImpl(project, name, text, StdFileTypes.XML);
-  }
 }