Java Code Examples for com.jetbrains.php.lang.PhpFileType#INSTANCE

The following examples show how to use com.jetbrains.php.lang.PhpFileType#INSTANCE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExtensionFileGenerationUtil.java    From idea-php-typo3-plugin with MIT License 6 votes vote down vote up
/**
 * @param templateFile           Name of the generated file
 * @param destinationPath        Relative path to the target file system entry
 * @param extensionRootDirectory Extension definition containing all relevant metadata
 * @param context                Template Context variables
 * @param project                Project in context
 */
public static PsiElement fromTemplate(@NotNull String templateFile, @NotNull String destinationPath, @NotNull String destinationFileName, @NotNull PsiDirectory extensionRootDirectory, @NotNull Map<String, String> context, Project project) {
    String template = readTemplateToString(templateFile, context);

    VirtualFile targetDirectory = getOrCreateDestinationPath(extensionRootDirectory.getVirtualFile(), destinationPath);

    LanguageFileType fileType = FileTypes.PLAIN_TEXT;
    if (templateFile.endsWith(".php")) {
        fileType = PhpFileType.INSTANCE;
    }

    PsiFile fileFromText = PsiFileFactory.getInstance(project).createFileFromText(destinationFileName, fileType, template);
    CodeStyleManager.getInstance(project).reformat(fileFromText);
    return PsiDirectoryFactory
            .getInstance(project)
            .createDirectory(targetDirectory)
            .add(fileFromText);
}
 
Example 2
Source File: VariadicSignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 3
Source File: ConfigKeyStubIndex.java    From idea-php-laravel-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE;
}
 
Example 4
Source File: ConfigIndex.java    From idea-php-shopware-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE || file.getFileType() == SmartyFileType.INSTANCE;
}
 
Example 5
Source File: BladeCustomDirectivesStubIndex.java    From idea-php-laravel-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() { return file -> file.getFileType() == PhpFileType.INSTANCE; }
 
Example 6
Source File: TranslationKeyStubIndex.java    From idea-php-laravel-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE;
}
 
Example 7
Source File: ReturnStringSignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 8
Source File: MethodParameterRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 9
Source File: VariadicSignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 10
Source File: ArrayKeyValueSignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 11
Source File: ArrayKeySignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 12
Source File: TemplateAnnotationIndex.java    From idea-php-generics-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return virtualFile -> virtualFile.getFileType() == PhpFileType.INSTANCE;
}
 
Example 13
Source File: PhpFunctionRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 14
Source File: ArrayKeyValueSignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 15
Source File: ReturnStringSignatureRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
@Override
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 16
Source File: ControllerActionIndex.java    From idea-php-typo3-plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE && file.getNameWithoutExtension().contains("Controller");
}
 
Example 17
Source File: PhpFunctionRegistrarMatcher.java    From idea-php-toolbox with MIT License 4 votes vote down vote up
public boolean supports(@NotNull FileType fileType) {
    return fileType == PhpFileType.INSTANCE;
}
 
Example 18
Source File: ConfigKeyStubIndex.java    From Thinkphp5-Plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE;
}
 
Example 19
Source File: ControllerStubIndex.java    From Thinkphp5-Plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE;
}
 
Example 20
Source File: ModelStubIndex.java    From Thinkphp5-Plugin with MIT License 4 votes vote down vote up
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
    return file -> file.getFileType() == PhpFileType.INSTANCE;
}