diff dwt/custom/PopupList.d @ 212:ab60f3309436

reverted the char[] to String and use the an alias.
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:12:38 +0200
parents a5afe31f5cdd
children a59d51c12b42
line wrap: on
line diff
--- a/dwt/custom/PopupList.d	Sat Apr 26 10:01:48 2008 +0200
+++ b/dwt/custom/PopupList.d	Mon May 05 00:12:38 2008 +0200
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*******************************************************************************
  * Copyright (c) 2000, 2007 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
@@ -29,6 +29,8 @@
 import dwt.widgets.List;
 import dwt.widgets.Listener;
 import dwt.widgets.Shell;
+import dwt.dwthelper.utils;
+
 /**
 * A PopupList is a list of selectable items that appears in its own shell positioned above
 * its parent shell.  It is used for selecting items when editing a Table cell (similar to the
@@ -127,7 +129,7 @@
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 *   </ul>
 */
-public char[][] getItems () {
+public String[] getItems () {
     return list.getItems();
 }
 /**
@@ -146,7 +148,7 @@
 *
 * @return the text of the selected item or null if no item is selected
 */
-public char[] open (Rectangle rect) {
+public String open (Rectangle rect) {
 
     Point listSize = list.computeSize (rect.width, DWT.DEFAULT, false);
     Rectangle screenSize = shell.getDisplay().getBounds();
@@ -194,16 +196,16 @@
         if (!display.readAndDispatch()) display.sleep();
     }
 
-    char[] result = null;
+    String result = null;
     if (!shell.isDisposed ()) {
-        char[] [] strings = list.getSelection ();
+        String [] strings = list.getSelection ();
         shell.dispose();
         if (strings.length !is 0) result = strings [0];
     }
     return result;
 }
 /**
-* Selects an item with text that starts with specified char[].
+* Selects an item with text that starts with specified String.
 * <p>
 * If the item is not currently selected, it is selected.
 * If the item at an index is selected, it remains selected.
@@ -216,8 +218,8 @@
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 *   </ul>
 */
-public void select(char[] string) {
-    char[][] items = list.getItems();
+public void select(String string) {
+    String[] items = list.getItems();
 
     // find the first entry in the list that starts with the
     // specified string
@@ -269,7 +271,7 @@
 *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
 *   </ul>
 */
-public void setItems (char[][] strings) {
+public void setItems (String[] strings) {
     list.setItems(strings);
 }
 /**