write(line.substring(lineIndex, copyEnd));
write(" "); int endOffset = startOffset + super.getCharCount(); int lineEndOffset = Math.min(lineLength, endOffset - lineOffset); for (int i = 0; i < styles.length; i++) {
write(" "); int endOffset = startOffset + super.getCharCount(); int lineEndOffset = Math.min(lineLength, endOffset - lineOffset); for (int i = 0; i < styles.length; i++) {
write(" "); int endOffset = startOffset + super.getCharCount(); int lineEndOffset = Math.min(lineLength, endOffset - lineOffset); for (int i = 0; i < styles.length; i++) {
write(" "); int endOffset = startOffset + super.getCharCount(); int lineEndOffset = Math.min(lineLength, endOffset - lineOffset); for (int i = 0; i < styles.length; i++) {
write(" "); int endOffset = startOffset + super.getCharCount(); int lineEndOffset = Math.min(lineLength, endOffset - lineOffset); for (int i = 0; i < styles.length; i++) {
/** * Copies the specified text range to the clipboard. The text will be placed * in the clipboard in plain text format and RTF format. * * @param start start index of the text * @param length length of text to place in clipboard * * @exception SWTError, see Clipboard.setContents * @see org.eclipse.swt.dnd.Clipboard#setContents */ void setClipboardContent(int start, int length, int clipboardType) throws SWTError { if (clipboardType == DND.SELECTION_CLIPBOARD && !IS_GTK) return; TextTransfer plainTextTransfer = TextTransfer.getInstance(); TextWriter plainTextWriter = new TextWriter(start, length); String plainText = getPlatformDelimitedText(plainTextWriter); Object[] data; Transfer[] types; if (clipboardType == DND.SELECTION_CLIPBOARD) { data = new Object[]{plainText}; types = new Transfer[]{plainTextTransfer}; } else { RTFTransfer rtfTransfer = RTFTransfer.getInstance(); RTFWriter rtfWriter = new RTFWriter(start, length); String rtfText = getPlatformDelimitedText(rtfWriter); data = new Object[]{rtfText, plainText}; types = new Transfer[]{rtfTransfer, plainTextTransfer}; } clipboard.setContents(data, types, clipboardType); } /**
/** * Copies the specified text range to the clipboard. The text will be placed * in the clipboard in plain text format and RTF format. * * @param start start index of the text * @param length length of text to place in clipboard * * @exception SWTError, see Clipboard.setContents * @see org.eclipse.swt.dnd.Clipboard#setContents */ void setClipboardContent(int start, int length, int clipboardType) throws SWTError { if (clipboardType == DND.SELECTION_CLIPBOARD && !(IS_MOTIF || IS_GTK)) return; TextTransfer plainTextTransfer = TextTransfer.getInstance(); TextWriter plainTextWriter = new TextWriter(start, length); String plainText = getPlatformDelimitedText(plainTextWriter); Object[] data; Transfer[] types; if (clipboardType == DND.SELECTION_CLIPBOARD) { data = new Object[]{plainText}; types = new Transfer[]{plainTextTransfer}; } else { RTFTransfer rtfTransfer = RTFTransfer.getInstance(); RTFWriter rtfWriter = new RTFWriter(start, length); String rtfText = getPlatformDelimitedText(rtfWriter); data = new Object[]{rtfText, plainText}; types = new Transfer[]{rtfTransfer, plainTextTransfer}; } clipboard.setContents(data, types, clipboardType); } /**
write(line.substring(lineIndex, copyEnd));
write(line.substring(lineIndex, copyEnd));
write(line.substring(lineIndex, copyEnd));
/** * Copies the specified text range to the clipboard. The text will be placed * in the clipboard in plain text format and RTF format. * * @param start start index of the text * @param length length of text to place in clipboard * * @exception SWTError, see Clipboard.setContents * @see org.eclipse.swt.dnd.Clipboard#setContents */ void setClipboardContent(int start, int length, int clipboardType) throws SWTError { if (clipboardType == DND.SELECTION_CLIPBOARD && !IS_GTK) return; TextTransfer plainTextTransfer = TextTransfer.getInstance(); TextWriter plainTextWriter = new TextWriter(start, length); String plainText = getPlatformDelimitedText(plainTextWriter); Object[] data; Transfer[] types; if (clipboardType == DND.SELECTION_CLIPBOARD) { data = new Object[]{plainText}; types = new Transfer[]{plainTextTransfer}; } else { RTFTransfer rtfTransfer = RTFTransfer.getInstance(); RTFWriter rtfWriter = new RTFWriter(start, length); String rtfText = getPlatformDelimitedText(rtfWriter); data = new Object[]{rtfText, plainText}; types = new Transfer[]{rtfTransfer, plainTextTransfer}; } clipboard.setContents(data, types, clipboardType); } /**
/** * Copies the specified text range to the clipboard. The text will be placed * in the clipboard in plain text format and RTF format. * * @param start start index of the text * @param length length of text to place in clipboard * * @exception SWTError, see Clipboard.setContents * @see org.eclipse.swt.dnd.Clipboard#setContents */ void setClipboardContent(int start, int length, int clipboardType) throws SWTError { if (clipboardType == DND.SELECTION_CLIPBOARD && !IS_GTK) return; TextTransfer plainTextTransfer = TextTransfer.getInstance(); TextWriter plainTextWriter = new TextWriter(start, length); String plainText = getPlatformDelimitedText(plainTextWriter); Object[] data; Transfer[] types; if (clipboardType == DND.SELECTION_CLIPBOARD) { data = new Object[]{plainText}; types = new Transfer[]{plainTextTransfer}; } else { RTFTransfer rtfTransfer = RTFTransfer.getInstance(); RTFWriter rtfWriter = new RTFWriter(start, length); String rtfText = getPlatformDelimitedText(rtfWriter); data = new Object[]{rtfText, plainText}; types = new Transfer[]{rtfTransfer, plainTextTransfer}; } clipboard.setContents(data, types, clipboardType); } /**
write(line.substring(lineIndex, copyEnd));
/** * Copies the specified text range to the clipboard. The text will be placed * in the clipboard in plain text format and RTF format. * * @param start start index of the text * @param length length of text to place in clipboard * * @exception SWTError, see Clipboard.setContents * @see org.eclipse.swt.dnd.Clipboard#setContents */ void setClipboardContent(int start, int length, int clipboardType) throws SWTError { if (clipboardType == DND.SELECTION_CLIPBOARD && !IS_GTK) return; TextTransfer plainTextTransfer = TextTransfer.getInstance(); TextWriter plainTextWriter = new TextWriter(start, length); String plainText = getPlatformDelimitedText(plainTextWriter); Object[] data; Transfer[] types; if (clipboardType == DND.SELECTION_CLIPBOARD) { data = new Object[]{plainText}; types = new Transfer[]{plainTextTransfer}; } else { RTFTransfer rtfTransfer = RTFTransfer.getInstance(); RTFWriter rtfWriter = new RTFWriter(start, length); String rtfText = getPlatformDelimitedText(rtfWriter); data = new Object[]{rtfText, plainText}; types = new Transfer[]{rtfTransfer, plainTextTransfer}; } clipboard.setContents(data, types, clipboardType); } /**
/** * Returns the content in the specified range using the platform line * delimiter to separate lines. * * @param writer the TextWriter to write line text into * @return the content in the specified range using the platform line * delimiter to separate lines as written by the specified TextWriter. */ String getPlatformDelimitedText(TextWriter writer) { int end = writer.getStart() + writer.getCharCount(); int startLine = content.getLineAtOffset(writer.getStart()); int endLine = content.getLineAtOffset(end); String endLineText = content.getLine(endLine); int endLineOffset = content.getOffsetAtLine(endLine); for (int i = startLine; i <= endLine; i++) { writer.writeLine(content.getLine(i), content.getOffsetAtLine(i)); if (i < endLine) { writer.writeLineDelimiter(PlatformLineDelimiter); } } if (end > endLineOffset + endLineText.length()) { writer.writeLineDelimiter(PlatformLineDelimiter); } writer.close(); return writer.toString(); } /**
/** * Returns the content in the specified range using the platform line * delimiter to separate lines. * * @param writer the TextWriter to write line text into * @return the content in the specified range using the platform line * delimiter to separate lines as written by the specified TextWriter. */ String getPlatformDelimitedText(TextWriter writer) { int end = writer.getStart() + writer.getCharCount(); int startLine = content.getLineAtOffset(writer.getStart()); int endLine = content.getLineAtOffset(end); String endLineText = content.getLine(endLine); int endLineOffset = content.getOffsetAtLine(endLine); for (int i = startLine; i <= endLine; i++) { writer.writeLine(content.getLine(i), content.getOffsetAtLine(i)); if (i < endLine) { writer.writeLineDelimiter(PlatformLineDelimiter); } } if (end > endLineOffset + endLineText.length()) { writer.writeLineDelimiter(PlatformLineDelimiter); } writer.close(); return writer.toString(); } /**
/** * Returns the content in the specified range using the platform line * delimiter to separate lines. * * @param writer the TextWriter to write line text into * @return the content in the specified range using the platform line * delimiter to separate lines as written by the specified TextWriter. */ String getPlatformDelimitedText(TextWriter writer) { int end = writer.getStart() + writer.getCharCount(); int startLine = content.getLineAtOffset(writer.getStart()); int endLine = content.getLineAtOffset(end); String endLineText = content.getLine(endLine); int endLineOffset = content.getOffsetAtLine(endLine); for (int i = startLine; i <= endLine; i++) { writer.writeLine(content.getLine(i), content.getOffsetAtLine(i)); if (i < endLine) { writer.writeLineDelimiter(PlatformLineDelimiter); } } if (end > endLineOffset + endLineText.length()) { writer.writeLineDelimiter(PlatformLineDelimiter); } writer.close(); return writer.toString(); } /**
/** * Returns the content in the specified range using the platform line * delimiter to separate lines. * * @param writer the TextWriter to write line text into * @return the content in the specified range using the platform line * delimiter to separate lines as written by the specified TextWriter. */ String getPlatformDelimitedText(TextWriter writer) { int end = writer.getStart() + writer.getCharCount(); int startLine = content.getLineAtOffset(writer.getStart()); int endLine = content.getLineAtOffset(end); String endLineText = content.getLine(endLine); int endLineOffset = content.getOffsetAtLine(endLine); for (int i = startLine; i <= endLine; i++) { writer.writeLine(content.getLine(i), content.getOffsetAtLine(i)); if (i < endLine) { writer.writeLineDelimiter(PlatformLineDelimiter); } } if (end > endLineOffset + endLineText.length()) { writer.writeLineDelimiter(PlatformLineDelimiter); } writer.close(); return writer.toString(); } /**
/** * Returns the content in the specified range using the platform line * delimiter to separate lines. * * @param writer the TextWriter to write line text into * @return the content in the specified range using the platform line * delimiter to separate lines as written by the specified TextWriter. */ String getPlatformDelimitedText(TextWriter writer) { int end = writer.getStart() + writer.getCharCount(); int startLine = content.getLineAtOffset(writer.getStart()); int endLine = content.getLineAtOffset(end); String endLineText = content.getLine(endLine); int endLineOffset = content.getOffsetAtLine(endLine); for (int i = startLine; i <= endLine; i++) { writer.writeLine(content.getLine(i), content.getOffsetAtLine(i)); if (i < endLine) { writer.writeLineDelimiter(PlatformLineDelimiter); } } if (end > endLineOffset + endLineText.length()) { writer.writeLineDelimiter(PlatformLineDelimiter); } writer.close(); return writer.toString(); } /**