String () { PsiElement element = getElement(); PsiFile psiFile = getPsiFile(); boolean isNullOrBinary = psiFile == null || psiFile.getFileType().isBinary(); if (element != null && isNullOrBinary) { return clsType(element) + " " + clsName(element); } int startOffset; if (element != null && (startOffset = getNavigationOffset()) != -1) { Document document = getDocument(); if (document != null) { int lineNumber = document.getLineNumber(startOffset); int lineStart = document.getLineStartOffset(lineNumber); int lineEnd = document.getLineEndOffset(lineNumber); String prefixSuffix = null; if (lineEnd - lineStart > ChunkExtractor.MAX_LINE_LENGTH_TO_SHOW) { prefixSuffix = "..."; lineStart = Math.max(startOffset - ChunkExtractor.OFFSET_BEFORE_TO_SHOW_WHEN_LONG_LINE, lineStart); lineEnd = Math.min(startOffset + ChunkExtractor.OFFSET_AFTER_TO_SHOW_WHEN_LONG_LINE, lineEnd); } String s = document.getCharsSequence().subSequence(lineStart, lineEnd).toString(); if (prefixSuffix != null) s = prefixSuffix + s + prefixSuffix; return s; } } return UsageViewBundle.message("node.invalid"); }