use of org.jetbrains.plugins.groovy.debugger.fragments.GroovyCodeFragment in project intellij-community by JetBrains.
the class DynamicDialog method createDocument.
@Nullable
private Document createDocument(final String text) {
GroovyCodeFragment fragment = new GroovyCodeFragment(myProject, text);
fragment.setContext(myContext);
return PsiDocumentManager.getInstance(myProject).getDocument(fragment);
}
use of org.jetbrains.plugins.groovy.debugger.fragments.GroovyCodeFragment in project intellij-community by JetBrains.
the class GrParameterTableModelItem method create.
public static GrParameterTableModelItem create(@Nullable GrParameterInfo parameterInfo, @NotNull final Project project, @Nullable final PsiElement context) {
if (parameterInfo == null) {
parameterInfo = new GrParameterInfo("", "", "", null, -1, false);
}
PsiTypeCodeFragment typeCodeFragment = JavaCodeFragmentFactory.getInstance(project).createTypeCodeFragment(parameterInfo.getTypeText(), context, true, JavaCodeFragmentFactory.ALLOW_ELLIPSIS);
String initializer = parameterInfo.getDefaultInitializer();
GroovyCodeFragment initializerCodeFragment = new GroovyCodeFragment(project, initializer != null ? initializer : "");
GroovyCodeFragment defaultValueCodeFragment = new GroovyCodeFragment(project, parameterInfo.getDefaultValue());
return new GrParameterTableModelItem(parameterInfo, typeCodeFragment, initializerCodeFragment, defaultValueCodeFragment);
}
use of org.jetbrains.plugins.groovy.debugger.fragments.GroovyCodeFragment in project intellij-community by JetBrains.
the class GroovyCodeFragmentFactory method createPresentationCodeFragment.
@Override
public JavaCodeFragment createPresentationCodeFragment(TextWithImports item, PsiElement context, Project project) {
GroovyCodeFragment result = new GroovyCodeFragment(project, item.getText());
result.setContext(context);
return result;
}
use of org.jetbrains.plugins.groovy.debugger.fragments.GroovyCodeFragment in project intellij-community by JetBrains.
the class GroovyStructuralSearchProfile method createCodeFragment.
@Override
public PsiCodeFragment createCodeFragment(Project project, String text, @Nullable PsiElement context) {
GroovyCodeFragment result = new GroovyCodeFragment(project, text);
result.setContext(context);
return result;
}
Aggregations