boolean formatFirstLine= prefix.trim().length() == 0; String formattedParagraph= format(strippedParagraph, indent, lineDelimiter, formatFirstLine);
String formattedParagraph= format(pastedText, newIndentSize, lineDelimiter, formatFirstLine);
	protected void smartPaste(IDocument document, DocumentCommand command) {		String lineDelimiter= getLineDelimiter(document);		try {			String pastedText= command.text;			Assert.isNotNull(pastedText);			Assert.isTrue(pastedText.length() > 1);						// #27512//			int selectionEnd= command.offset + command.length;//			IRegion region= document.getLineInformationOfOffset(selectionEnd);//			String selected= document.get(region.getOffset(), selectionEnd - region.getOffset());//			String notSelected= document.get(selectionEnd, region.getOffset() + region.getLength() - selectionEnd);//			if (selected.trim().length() == 0 && notSelected.trim().length() != 0) {//				pastedText += notSelected;//				command.length += notSelected.length();//			}						String strippedParagraph= stripIndent(pastedText, lineDelimiter);			// check selection			int offset= command.offset;			int line= document.getLineOfOffset(offset);			int lineOffset= document.getLineOffset(line);			// format			String prefix= document.get(lineOffset, offset - lineOffset);			String blockIndent= getBlockIndent(document, command);			String insideBlockIndent= blockIndent == null ? "" : blockIndent + createIndent(1); //$NON-NLS-1$ // add one indent level			String previousIndent= getIndent(document, command);			String indent= calculateDisplayedWidth(insideBlockIndent) < calculateDisplayedWidth(previousIndent)				? insideBlockIndent				: previousIndent;			boolean formatFirstLine= prefix.trim().length() == 0;			String formattedParagraph= format(strippedParagraph, indent, lineDelimiter, formatFirstLine);			// paste			if (formatFirstLine) {				int end= command.offset + command.length;				command.offset= lineOffset;				command.length= end - command.offset;			}			command.text= formattedParagraph;		} catch (BadLocationException e) {			JavaPlugin.log(e);		}	}