1 11 package org.eclipse.debug.internal.ui.views.memory.renderings; 12 13 import java.util.ArrayList ; 14 15 import org.eclipse.jface.viewers.StructuredViewer; 16 import org.eclipse.swt.widgets.Table; 17 import org.eclipse.swt.widgets.TableItem; 18 19 23 public class AsyncCopyTableRenderingAction extends 24 CopyTableRenderingToClipboardAction { 25 26 public AsyncCopyTableRenderingAction(AbstractBaseTableRendering rendering, StructuredViewer viewer) { 27 super(rendering, viewer); 28 } 29 30 protected String concatenateTableAsString(TableItem[] itemList) { 31 32 Table table = null; 33 if (itemList.length > 0) 34 table = itemList[0].getParent(); 35 36 int topIndex = table.getTopIndex(); 37 int itemCount = table.getItemCount(); 38 int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex); 39 40 ArrayList items = new ArrayList (); 41 42 for (int i=topIndex; i< topIndex + numVisibleLines; i++) 44 { 45 if (itemList[i].getData() != null) 46 { 47 items.add(itemList[i]); 48 } 49 else 50 break; 51 } 52 53 return super.concatenateTableAsString((TableItem[]) items.toArray(new TableItem[items.size()])); 54 } 55 } 56 | Popular Tags |