diff dwt/custom/SashFormData.d @ 41:6337764516f1

Sync dwt/custom with dwt-linux (took copy of complete folder)
author Frank Benoit <benoit@tionex.de>
date Tue, 07 Oct 2008 16:29:55 +0200
parents 380af2bdd8e5
children
line wrap: on
line diff
--- a/dwt/custom/SashFormData.d	Tue Oct 07 14:41:31 2008 +0200
+++ b/dwt/custom/SashFormData.d	Tue Oct 07 16:29:55 2008 +0200
@@ -7,27 +7,34 @@
  *
  * Contributors:
  *     IBM Corporation - initial API and implementation
+ * Port to the D programming language:
+ *     Frank Benoit <benoit@tionex.de>
  *******************************************************************************/
-module dwt.custom;
+module dwt.custom.SashFormData;
+
+import dwt.dwthelper.utils;
+
+static import tango.text.Util;
+import tango.util.Convert;
 
 class SashFormData {
 
     long weight;
 
 String getName () {
-    String String = getClass ().getName ();
-    int index = String.lastIndexOf ('.');
-    if (index is -1) return String;
-    return String.substring (index + 1, String.length ());
+    String string = this.classinfo.name;
+    int index = tango.text.Util.locatePrior( string ,'.' );
+    if (index is string.length ) return string;
+    return string[ index + 1 .. $ ];
 }
 
 /**
- * Returns a String containing a concise, human-readable
+ * Returns a string containing a concise, human-readable
  * description of the receiver.
  *
- * @return a String representation of the event
+ * @return a string representation of the event
  */
-public String toString () {
-    return getName()+" {weight="+weight+"}"; //$NON-NLS-2$
+public override String toString () {
+    return getName()~" {weight="~to!(String)(weight)~"}"; //$NON-NLS-2$
 }
 }