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.
17 package org
.intellij
.plugins
.intelliLang
.inject
.groovy
;
19 import com
.intellij
.lang
.Language
;
20 import com
.intellij
.openapi
.options
.Configurable
;
21 import com
.intellij
.openapi
.project
.Project
;
22 import com
.intellij
.psi
.PsiLanguageInjectionHost
;
23 import com
.intellij
.psi
.PsiElement
;
24 import org
.intellij
.plugins
.intelliLang
.Configuration
;
25 import org
.intellij
.plugins
.intelliLang
.inject
.LanguageInjectionSupport
;
26 import org
.intellij
.plugins
.intelliLang
.inject
.config
.BaseInjection
;
27 import org
.jdom
.Element
;
28 import org
.jetbrains
.annotations
.NonNls
;
29 import org
.jetbrains
.annotations
.NotNull
;
30 import org
.jetbrains
.plugins
.groovy
.lang
.psi
.patterns
.GroovyPatterns
;
31 import org
.jetbrains
.plugins
.groovy
.lang
.psi
.GroovyPsiElement
;
34 * @author Gregory.Shrago
36 public class GroovyLanguageInjectionSupport
implements LanguageInjectionSupport
{
37 @NonNls private static final String SUPPORT_ID
= "groovy";
40 public String
getId() {
45 public Class
[] getPatternClasses() {
46 return new Class
[] {GroovyPatterns
.class};
49 public boolean useDefaultInjector(final PsiElement host
) {
50 return host
instanceof GroovyPsiElement
;
53 public boolean addInjectionInPlace(final Language language
, final PsiLanguageInjectionHost psiElement
) {
57 public boolean removeInjectionInPlace(final PsiLanguageInjectionHost psiElement
) {
61 public boolean editInjectionInPlace(final PsiLanguageInjectionHost psiElement
) {
65 public BaseInjection
createInjection(final Element element
) {
66 return new BaseInjection(SUPPORT_ID
);
69 public Configurable
[] createSettings(final Project project
, final Configuration configuration
) {
70 return new Configurable
[0];