25
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2005 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module org.eclipse.swt.custom.SashFormData;
|
|
14
|
|
15 import java.lang.all;
|
|
16
|
48
|
17 version(Tango){
|
25
|
18 static import tango.text.Util;
|
|
19 import tango.util.Convert;
|
48
|
20 } else { // Phobos
|
|
21 }
|
25
|
22
|
|
23 class SashFormData {
|
|
24
|
|
25 long weight;
|
|
26
|
|
27 String getName () {
|
|
28 String string = this.classinfo.name;
|
|
29 int index = tango.text.Util.locatePrior( string ,'.' );
|
|
30 if (index is string.length ) return string;
|
|
31 return string[ index + 1 .. $ ];
|
|
32 }
|
|
33
|
|
34 /**
|
|
35 * Returns a string containing a concise, human-readable
|
|
36 * description of the receiver.
|
|
37 *
|
|
38 * @return a string representation of the event
|
|
39 */
|
|
40 public override String toString () {
|
|
41 return getName()~" {weight="~to!(String)(weight)~"}"; //$NON-NLS-2$
|
|
42 }
|
|
43 }
|