ComponentWithBrowseButton - optional remove listener on hide
[fedora-idea.git] / plugins / groovy / src / org / jetbrains / plugins / groovy / compiler / GroovyCompilerLoader.java
blob11f5e50feba64cc91c0c075d71bc07d65e13831f
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.jetbrains.plugins.groovy.compiler;
18 import com.intellij.openapi.compiler.CompilerManager;
19 import com.intellij.openapi.components.AbstractProjectComponent;
20 import com.intellij.openapi.fileTypes.FileType;
21 import com.intellij.openapi.fileTypes.StdFileTypes;
22 import com.intellij.openapi.project.Project;
23 import org.jetbrains.annotations.NotNull;
24 import org.jetbrains.plugins.groovy.GroovyFileType;
25 import org.jetbrains.plugins.groovy.compiler.generator.GroovycStubGenerator;
27 import java.util.Arrays;
28 import java.util.HashSet;
30 /**
31 * @author ilyas
33 public class GroovyCompilerLoader extends AbstractProjectComponent {
35 public GroovyCompilerLoader(Project project) {
36 super(project);
39 public void projectOpened() {
40 CompilerManager compilerManager = CompilerManager.getInstance(myProject);
41 compilerManager.addCompilableFileType(GroovyFileType.GROOVY_FILE_TYPE);
43 compilerManager.addTranslatingCompiler(new GroovycStubGenerator(myProject),
44 new HashSet<FileType>(Arrays.asList(GroovyFileType.GROOVY_FILE_TYPE)),
45 new HashSet<FileType>(Arrays.asList(StdFileTypes.JAVA)));
47 compilerManager.addTranslatingCompiler(new GroovyCompiler(myProject),
48 new HashSet<FileType>(Arrays.asList(GroovyFileType.GROOVY_FILE_TYPE, StdFileTypes.CLASS)),
49 new HashSet<FileType>(Arrays.asList(StdFileTypes.CLASS)));
52 @NotNull
53 public String getComponentName() {
54 return "GroovyCompilerLoader";