Example usage for com.intellij.openapi.fileTypes StdFileTypes PROPERTIES

List of usage examples for com.intellij.openapi.fileTypes StdFileTypes PROPERTIES

Introduction

In this page you can find the example usage for com.intellij.openapi.fileTypes StdFileTypes PROPERTIES.

Prototype

LanguageFileType PROPERTIES

To view the source code for com.intellij.openapi.fileTypes StdFileTypes PROPERTIES.

Click Source Link

Usage

From source file:com.github.shyiko.native2asciiplug.Native2AsciiPlugCompiler.java

License:Apache License

@NotNull
public ProcessingItem[] getProcessingItems(final CompileContext compileContext) {
    final List<ProcessingItem> result = new ArrayList<ProcessingItem>();
    ApplicationManager.getApplication().runReadAction(new Runnable() {
        public void run() {
            ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
            for (VirtualFile sourceFile : compileContext.getCompileScope().getFiles(StdFileTypes.PROPERTIES,
                    true)) {//w  w  w . java2  s  .  c  o  m
                String targetFilePath = getTargetFilePath(compileContext, fileIndex, sourceFile);
                if (targetFilePath != null) {
                    result.add(new Native2AsciiPlugProcessingItem(sourceFile, targetFilePath));
                }
            }
        }
    });
    return result.toArray(new ProcessingItem[result.size()]);
}

From source file:com.github.shyiko.native2asciiplug.Native2AsciiPlugProjectComponent.java

License:Apache License

public void projectOpened() {
    if (isOutOfProcessBuildTurnedOn()) {
        injectCompilerForOutOfProcessBuild();
    } else {//from www.  java2s .  c  om
        compilerManager.addCompiler(compiler);
    }
    compilerManager.addCompilableFileType(StdFileTypes.PROPERTIES);
}

From source file:com.github.shyiko.native2asciiplug.Native2AsciiPlugProjectComponent.java

License:Apache License

public void projectClosed() {
    compilerManager.removeCompilableFileType(StdFileTypes.PROPERTIES);
    compilerManager.removeCompiler(compiler);
}

From source file:com.intellij.lang.properties.parsing.PropertiesElementType.java

License:Apache License

public PropertiesElementType(@NonNls String debugName) {
    super(debugName, StdFileTypes.PROPERTIES.getLanguage());
}

From source file:com.intellij.lang.properties.projectView.ResourceBundleNode.java

License:Apache License

public Comparable getTypeSortKey() {
    return new PsiFileNode.ExtensionSortKey(StdFileTypes.PROPERTIES.getDefaultExtension());
}

From source file:com.intellij.lang.properties.psi.impl.PropertiesElementImpl.java

License:Apache License

@NotNull
public Language getLanguage() {
    return StdFileTypes.PROPERTIES.getLanguage();
}

From source file:com.intellij.lang.properties.psi.impl.PropertiesFileImpl.java

License:Apache License

public PropertiesFileImpl(FileViewProvider viewProvider) {
    super(viewProvider, StdFileTypes.PROPERTIES.getLanguage());
}

From source file:com.intellij.lang.properties.psi.impl.PropertiesFileImpl.java

License:Apache License

@NotNull
public FileType getFileType() {
    return StdFileTypes.PROPERTIES;
}

From source file:com.intellij.lang.properties.psi.PropertiesElementFactory.java

License:Apache License

@NotNull
public static PropertiesFile createPropertiesFile(@NotNull Project project, @NonNls @NotNull String text) {
    @NonNls/*from   ww  w. j av a2s  . c o  m*/
    String filename = "dummy." + StdFileTypes.PROPERTIES.getDefaultExtension();
    return (PropertiesFile) PsiFileFactory.getInstance(project).createFileFromText(filename,
            StdFileTypes.PROPERTIES, text);
}

From source file:com.intellij.lang.properties.psi.PropertiesElementFactory.java

License:Apache License

@NotNull
public static PropertiesFile createPropertiesFile(@NotNull Project project, Properties properties,
        String fileName) {//  w  w  w  .  j ava 2 s.  c  om
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    try {
        properties.store(stream, "");
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
    @NonNls
    String filename = fileName + "." + StdFileTypes.PROPERTIES.getDefaultExtension();
    return (PropertiesFile) PsiFileFactory.getInstance(project).createFileFromText(filename,
            StdFileTypes.PROPERTIES, stream.toString());
}