Package com.intellij.openapi.fileTypes

Examples of com.intellij.openapi.fileTypes.FileType


   *     Content of the Mathematica file
   * @return The newly created PsiFile with content code
   */
  @NotNull
  private MathematicaPsiFile createDummyFile(@NotNull CharSequence code) {
    final FileType type = MathematicaFileType.INSTANCE;
    return (MathematicaPsiFile) PsiFileFactory.getInstance(myProject).createFileFromText(DUMMY_FILE_NAME, type, code);
  }
View Full Code Here


    myCommenterLanguage.setRenderer(new ListCellRendererWrapper(myCommenterLanguage.getRenderer()) {
      @Override
      public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
        setText(value == null ? "" : ((Language)value).getDisplayName());
        if (value != null) {
          final FileType type = ((Language)value).getAssociatedFileType();
          if (type != null) {
            setIcon(type.getIcon());
          }
        }
      }
    });
    myCommenterLanguage.setSelectedItem(commentLanguage);
View Full Code Here

        ModuleFileIndex index = ModuleRootManager.getInstance(module).getFileIndex();
        final List<String> files = new ArrayList<String>();
        index.iterateContent(new ContentIterator() {
            public boolean processFile(VirtualFile fileOrDir) {
                if (!fileOrDir.isDirectory()) {
                    FileType fileType = fileOrDir.getFileType();
                    String path = fileOrDir.getPath();
                    if (HaskellFileType.INSTANCE.equals(fileType) && !Paths.get(path).equals(except)) {
                        files.add(path);
                    }
                }
View Full Code Here

    public boolean isCompilableFile(VirtualFile file, CompileContext context) {
        return isCompilableFile(file);
    }

    public static boolean isCompilableFile(VirtualFile file) {
        FileType fileType = FileTypeManager.getInstance().getFileTypeByFile(file);
        return HaskellFileType.INSTANCE.equals(fileType);
    }
View Full Code Here

import org.jetbrains.annotations.NotNull;

public abstract class DBLanguageFileTypeFactory extends FileTypeFactory {
    @Override
    public void createFileTypes(@NotNull FileTypeConsumer consumer) {
        FileType fileType = getFileType();
        consumer.consume(fileType, fileType.getDefaultExtension());
    }
View Full Code Here

        this.fileType = fileType;
    }

    @Nullable
    public static TextContentType create(String name, String fileTypeName) {
        FileType fileType = FileTypeManager.getInstance().getStdFileType(fileTypeName);
        // if returned expected file type
        if (fileType.getName().equals(fileTypeName)) {
            return new TextContentType(name, fileType);
        }
        return null;
    }
View Full Code Here

  public boolean accept(final File file) {
    if (file.isDirectory()) {
      addFiles(_findBugsProject, file);
    } else {
      // add the classes to the list of files to be analysed
      final FileType type = IdeaUtilImpl.getFileTypeByName(file.getName());
      if (IdeaUtilImpl.isValidFileType(type)) {
        final String filePath = file.getAbsolutePath();
        _findBugsProject.addFile(filePath);
        LOGGER.debug("adding class file: " + filePath);
      }
View Full Code Here

    public LatteTemplateHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile, @NotNull EditorColorsScheme colors) {
        // create main highlighter
        super(new LatteSyntaxHighlighter(), colors);

        // highlighter for outer lang
        FileType type = null;
        if(project == null || virtualFile == null) {
            type = StdFileTypes.PLAIN_TEXT;
        } else {
          Language language = TemplateDataLanguageMappings.getInstance(project).getMapping(virtualFile);
          if(language != null) type = language.getAssociatedFileType();
View Full Code Here

    }

    public void initComponent()
    {
        // auto-associate .awl files as htm if not otherwise mapped
        FileType awlType = FileTypeManager.getInstance().getFileTypeByExtension("awl");
        if (awlType.getName().endsWith("UnknownFileType") || awlType.getName().equals("UNKNOWN")) {
            FileType htmType = FileTypeManager.getInstance().getFileTypeByExtension("htm");
            FileTypeManager.getInstance().registerFileType(htmType, new String[] {"awl"});
        }

        // auto-associate .oss files as text if not otherwise mapped
        FileType ossType = FileTypeManager.getInstance().getFileTypeByExtension("oss");
        if (ossType.getName().endsWith("UnknownFileType") || ossType.getName().equals("UNKNOWN")) {
            FileType txtType = FileTypeManager.getInstance().getFileTypeByExtension("txt");
            FileTypeManager.getInstance().registerFileType(txtType, new String[] {"oss"});
        }

        // Load our bundled live templates
        InputStream is = getClass().getResourceAsStream("/ariba/ideplugin/idea/livetemplates.xml");
View Full Code Here

    /**
     * get ResourceInfo from PsiFile
     */
    @Nullable
    public static ResourceInfo from(@NotNull PsiFile file) {
        FileType fileType = file.getFileType();
        if (StdFileTypes.HTML.equals(fileType)) {
            return fromMarkup(file.getVirtualFile(), file.getProject(), file.getText());
        } else if (StdFileTypes.PROPERTIES.equals(fileType) || StdFileTypes.XML.equals(fileType)) {
            return fromProperties(file.getVirtualFile(), file.getProject());
        }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.fileTypes.FileType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.