GrTypeElement () { final Document typeEditorDocument = getTypeEditorDocument(); if (typeEditorDocument == null) return null; try { return GroovyPsiElementFactory.getInstance(myProject).createTypeElement(typeEditorDocument.getText()); } catch (IncorrectOperationException e) { return null; } }