diff options
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java index ed3b15f22..d132fbedc 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2009 IBM Corporation and others. + * Copyright (c) 2006, 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -20,8 +20,9 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; /** - * Print action for <code>AbstractAsyncTableRendering</code>. Only print what is visible in the view. - * + * Print action for <code>AbstractAsyncTableRendering</code>. Only print what is + * visible in the view. + * */ public class AsyncPrintTableRenderingAction extends PrintTableRenderingAction { @@ -29,29 +30,28 @@ public class AsyncPrintTableRenderingAction extends PrintTableRenderingAction { super(rendering, viewer); } + @Override protected void printTable(TableItem[] itemList, GC printGC, Printer printer) { Table table = null; if (itemList.length > 0) { table = itemList[0].getParent(); - + int topIndex = table.getTopIndex(); int itemCount = table.getItemCount(); - int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex); - - ArrayList items = new ArrayList(); - + int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex); + + ArrayList<TableItem> items = new ArrayList<TableItem>(); + // start at top index until there is no more data in the table - for (int i=topIndex; i< topIndex + numVisibleLines; i++) - { - if (itemList[i].getData() != null) - { + for (int i = topIndex; i < topIndex + numVisibleLines; i++) { + if (itemList[i].getData() != null) { items.add(itemList[i]); - } - else + } else { break; + } } - - super.printTable((TableItem[])items.toArray(new TableItem[items.size()]), printGC, printer); + + super.printTable(items.toArray(new TableItem[items.size()]), printGC, printer); } } } |