comparison 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
comparison
equal deleted inserted replaced
40:fbe68c33eeee 41:6337764516f1
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.custom; 13 module dwt.custom.SashFormData;
14
15 import dwt.dwthelper.utils;
16
17 static import tango.text.Util;
18 import tango.util.Convert;
12 19
13 class SashFormData { 20 class SashFormData {
14 21
15 long weight; 22 long weight;
16 23
17 String getName () { 24 String getName () {
18 String String = getClass ().getName (); 25 String string = this.classinfo.name;
19 int index = String.lastIndexOf ('.'); 26 int index = tango.text.Util.locatePrior( string ,'.' );
20 if (index is -1) return String; 27 if (index is string.length ) return string;
21 return String.substring (index + 1, String.length ()); 28 return string[ index + 1 .. $ ];
22 } 29 }
23 30
24 /** 31 /**
25 * Returns a String containing a concise, human-readable 32 * Returns a string containing a concise, human-readable
26 * description of the receiver. 33 * description of the receiver.
27 * 34 *
28 * @return a String representation of the event 35 * @return a string representation of the event
29 */ 36 */
30 public String toString () { 37 public override String toString () {
31 return getName()+" {weight="+weight+"}"; //$NON-NLS-2$ 38 return getName()~" {weight="~to!(String)(weight)~"}"; //$NON-NLS-2$
32 } 39 }
33 } 40 }