@Override String getText(ISelection selection) throws BadLocationException { IBlockTextSelection cts= (IBlockTextSelection)selection; StringBuilder buf= new StringBuilder(cts.getLength()); int startLine= cts.getStartLine(); int endLine= cts.getEndLine(); int startColumn= cts.getStartColumn(); int endColumn= cts.getEndColumn(); int visualStartColumn= computeVisualColumn(startLine, startColumn); int visualEndColumn= computeVisualColumn(endLine, endColumn); for (int line= startLine; line <= endLine; line++) { appendColumnRange(buf, line, visualStartColumn, visualEndColumn); if (line != endLine) buf.append(fDocument.getLineDelimiter(line)); } return buf.toString(); }
@Override String getText(ISelection selection) throws BadLocationException { IBlockTextSelection cts= (IBlockTextSelection)selection; StringBuffer buf= new StringBuffer(cts.getLength()); int startLine= cts.getStartLine(); int endLine= cts.getEndLine(); int startColumn= cts.getStartColumn(); int endColumn= cts.getEndColumn(); int visualStartColumn= computeVisualColumn(startLine, startColumn); int visualEndColumn= computeVisualColumn(endLine, endColumn); for (int line= startLine; line <= endLine; line++) { appendColumnRange(buf, line, visualStartColumn, visualEndColumn); if (line != endLine) buf.append(fDocument.getLineDelimiter(line)); } return buf.toString(); }
IBlockTextSelection bts= (IBlockTextSelection) selection; int startVirtual= Math.max(0, bts.getStartColumn() - document.getLineInformationOfOffset(bts.getOffset()).getLength()); int endVirtual= Math.max(0, bts.getEndColumn() - document.getLineInformationOfOffset(bts.getOffset() + bts.getLength()).getLength()); fSelection= new ColumnPosition(bts.getOffset(), bts.getLength(), startVirtual, endVirtual); } else { Point range= fTextWidget.getSelectionRange();
IBlockTextSelection bts= (IBlockTextSelection) selection; int startVirtual= Math.max(0, bts.getStartColumn() - document.getLineInformationOfOffset(bts.getOffset()).getLength()); int endVirtual= Math.max(0, bts.getEndColumn() - document.getLineInformationOfOffset(bts.getOffset() + bts.getLength()).getLength()); fSelection= new ColumnPosition(bts.getOffset(), bts.getLength(), startVirtual, endVirtual); } else { Point range= fTextWidget.getSelectionRange();