use of org.eclipse.scout.rt.client.ui.dnd.TextTransferObject in project scout.rt by eclipse.
the class AbstractTable method execCopy.
/**
* Called by a <code>CTRL-C</code> event on the table to copy the given rows into the clipboard.
* <p>
* Subclasses can override this method. The default creates a {@link TextTransferObject} of the table content (HTML
* table).
*
* @param rows
* The selected table rows to copy.
* @return A transferable object representing the given rows or null to not populate the clipboard.
*/
@ConfigOperation
@Order(30)
protected TransferObject execCopy(List<? extends ITableRow> rows) {
if (!CollectionUtility.hasElements(rows)) {
return null;
}
StringBuilder plainText = new StringBuilder();
List<IColumn<?>> columns = getColumnSet().getVisibleColumns();
boolean firstRow = true;
for (ITableRow row : rows) {
appendCopyTextForRow(plainText, row, firstRow, columns);
firstRow = false;
}
TextTransferObject transferObject = new TextTransferObject(plainText.toString());
return transferObject;
}
Aggregations