Mercurial > projects > dwt-samples
diff jface/snippets/Snippet031TableViewerCustomTooltipsMultiSelection.d @ 143:42c3056512ba
redirect the jface examples to the new collection wrappers
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 07 Aug 2008 22:21:50 +0200 |
parents | bf8adb3de664 |
children |
line wrap: on
line diff
--- a/jface/snippets/Snippet031TableViewerCustomTooltipsMultiSelection.d Thu Aug 07 17:23:25 2008 +0200 +++ b/jface/snippets/Snippet031TableViewerCustomTooltipsMultiSelection.d Thu Aug 07 22:21:50 2008 +0200 @@ -8,15 +8,14 @@ * Contributors: * Adam Neal - initial API and implementation * Port to the D programming language: - * yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ ) + * yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ ) *******************************************************************************/ module jface.snippets.Snippet031TableViewerCustomTooltipsMultiSelection; // http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.java?view=markup -import tango.util.collection.ArrayBag; -alias ArrayBag!(MyModel) ArrayList; +import dwtx.dwtxhelper.Collection; import tango.util.Convert; import dwtx.jface.viewers.ArrayContentProvider; @@ -46,14 +45,14 @@ } /** - * A simple TableViewer to demonstrate how custom tooltips could be created easily while preserving + * A simple TableViewer to demonstrate how custom tooltips could be created easily while preserving * the multiple selection. - * + * * This is a modified example taken from Tom Schindl's Snippet023TreeViewerCustomTooltips.java - * + * * This code is for users pre 3.3 others could use newly added tooltip support in {@link CellLabelProvider} * @author Adam Neal <Adam_Neal@ca.ibm.com> - * + * */ public class Snippet031TableViewerCustomTooltipsMultiSelection { public class MyLableProvider : ITableLabelProvider { @@ -63,7 +62,7 @@ } public String getColumnText(Object element, int columnIndex) { - //if (element instanceof MyModel) { + //if (element instanceof MyModel) { switch (columnIndex) { case 0: return (cast(MyModel)element).col1; case 1: return (cast(MyModel)element).col2; @@ -226,7 +225,7 @@ /* Construct the new Selection[] to show */ TableItem [] newSelection = null; if (isCTRLDown(event)) { - /* We have 2 scenario's. + /* We have 2 scenario's. * 1) We are selecting an already selected element - so remove it from the selected indices * 2) We are selecting a non-selected element - so add it to the selected indices */