Search in sources :

Example 1 with Compiler

use of com.intellij.openapi.compiler.Compiler in project intellij-community by JetBrains.

the class ValidationConfigurable method getValidators.

private List<Compiler> getValidators() {
    final CompilerManager compilerManager = CompilerManager.getInstance(myProject);
    final List<Compiler> validators = new ArrayList<>();
    validators.addAll(Arrays.asList(compilerManager.getCompilers(Validator.class)));
    for (GenericCompiler compiler : compilerManager.getCompilers(GenericCompiler.class)) {
        if (compiler.getOrderPlace() == GenericCompiler.CompileOrderPlace.VALIDATING) {
            validators.add(compiler);
        }
    }
    return validators;
}
Also used : GenericCompiler(com.intellij.openapi.compiler.generic.GenericCompiler) Compiler(com.intellij.openapi.compiler.Compiler) CompilerManager(com.intellij.openapi.compiler.CompilerManager) GenericCompiler(com.intellij.openapi.compiler.generic.GenericCompiler)

Example 2 with Compiler

use of com.intellij.openapi.compiler.Compiler in project intellij-community by JetBrains.

the class CompilerManagerImpl method getCompilers.

@NotNull
public <T extends Compiler> T[] getCompilers(@NotNull Class<T> compilerClass, CompilerFilter filter) {
    final List<T> compilers = new ArrayList<>(myCompilers.size());
    for (final Compiler item : myCompilers) {
        if (compilerClass.isAssignableFrom(item.getClass()) && filter.acceptCompiler(item)) {
            compilers.add((T) item);
        }
    }
    final T[] array = (T[]) Array.newInstance(compilerClass, compilers.size());
    return compilers.toArray(array);
}
Also used : Compiler(com.intellij.openapi.compiler.Compiler) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with Compiler

use of com.intellij.openapi.compiler.Compiler in project intellij-community by JetBrains.

the class ValidationConfigurable method apply.

public void apply() throws ConfigurationException {
    myConfiguration.VALIDATE_ON_BUILD = myValidateBox.isSelected();
    for (int i = 0; i < myValidators.getElementCount(); i++) {
        final Compiler validator = myValidators.getElementAt(i);
        myConfiguration.setSelected(validator, myValidators.isElementMarked(validator));
    }
    myExcludedConfigurable.apply();
}
Also used : GenericCompiler(com.intellij.openapi.compiler.generic.GenericCompiler) Compiler(com.intellij.openapi.compiler.Compiler)

Aggregations

Compiler (com.intellij.openapi.compiler.Compiler)3 GenericCompiler (com.intellij.openapi.compiler.generic.GenericCompiler)2 CompilerManager (com.intellij.openapi.compiler.CompilerManager)1 NotNull (org.jetbrains.annotations.NotNull)1