/** * Creates a column selection for the given lines and columns. * * @param document the document that this selection refers to * @param startLine the start line * @param startColumn the possibly virtual start column, measured in characters from the start * of <code>startLine</code> * @param endLine the inclusive end line * @param endColumn the exclusive and possibly virtual end column, measured in characters from * the start of <code>endLine</code> * @param tabWidth the tabulator width used to compute the visual offsets from character offsets */ public BlockTextSelection(IDocument document, int startLine, int startColumn, int endLine, int endColumn, int tabWidth) { super(document, computeOffset(document, startLine, startColumn), computeOffset(document, endLine, endColumn) - computeOffset(document, startLine, startColumn)); Assert.isLegal(startLine >= 0); Assert.isLegal(startColumn >= 0); Assert.isLegal(endLine >= startLine); Assert.isLegal(endColumn >= 0); Assert.isLegal(tabWidth >= 0); fStartLine= startLine; fStartColumn= startColumn; fEndLine= endLine; fEndColumn= endColumn; fTabWidth= tabWidth > 0 ? tabWidth : 8; // seems to be the default when StyledText.getTabs returns 0 }
/** * Creates a column selection for the given lines and columns. * * @param document the document that this selection refers to * @param startLine the start line * @param startColumn the possibly virtual start column, measured in characters from the start * of <code>startLine</code> * @param endLine the inclusive end line * @param endColumn the exclusive and possibly virtual end column, measured in characters from * the start of <code>endLine</code> * @param tabWidth the tabulator width used to compute the visual offsets from character offsets */ public BlockTextSelection(IDocument document, int startLine, int startColumn, int endLine, int endColumn, int tabWidth) { super(document, computeOffset(document, startLine, startColumn), computeOffset(document, endLine, endColumn) - computeOffset(document, startLine, startColumn)); Assert.isLegal(startLine >= 0); Assert.isLegal(startColumn >= 0); Assert.isLegal(endLine >= startLine); Assert.isLegal(endColumn >= 0); Assert.isLegal(tabWidth >= 0); fStartLine= startLine; fStartColumn= startColumn; fEndLine= endLine; fEndColumn= endColumn; fTabWidth= tabWidth > 0 ? tabWidth : 8; // seems to be the default when StyledText.getTabs returns 0 }