comparison dwt/browser/ProgressEvent.d @ 298:eec6ddb07873

More xpcom/mozilla port
author John Reimer<terminal.node@gmail.com>
date Sun, 10 Aug 2008 22:25:43 -0700
parents 44258e0b6687
children 3f4a5c7d138f
comparison
equal deleted inserted replaced
297:2f204a4aebc6 298:eec6ddb07873
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 * John Reimer <terminal.node@gmail.com>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.browser.ProgressEvent; 13 module dwt.browser.ProgressEvent;
12 14
13 import dwt.dwthelper.utils; 15 import tango.text.convert.Format;
14 16
15 import dwt.events.TypedEvent; 17 import dwt.events.TypedEvent;
16 import dwt.widgets.Widget; 18 import dwt.widgets.Widget;
17 19
18 /** 20 /**
21 * loading of the current URL or when the loading of the current 23 * loading of the current URL or when the loading of the current
22 * URL has been completed. 24 * URL has been completed.
23 * 25 *
24 * @since 3.0 26 * @since 3.0
25 */ 27 */
26 public class ProgressEvent extends TypedEvent { 28 public class ProgressEvent : TypedEvent {
27 /** current value */ 29 /** current value */
28 public int current; 30 public int current;
29 /** total value */ 31 /** total value */
30 public int total; 32 public int total;
31 33
32 static final long serialVersionUID = 3977018427045393972L; 34 static final long serialVersionUID = 3977018427045393972L;
33 35
34 ProgressEvent(Widget w) { 36 this(Widget w) {
35 super(w); 37 super(w);
36 } 38 }
37 39
38 /** 40 /**
39 * Returns a string containing a concise, human-readable 41 * Returns a string containing a concise, human-readable
40 * description of the receiver. 42 * description of the receiver.
41 * 43 *
42 * @return a string representation of the event 44 * @return a string representation of the event
43 */ 45 */
44 public String toString() { 46 public override String toString() {
45 String string = super.toString (); 47 return Format( "{} {current = {}, total = {}}",
46 return string.substring (0, string.length() - 1) // remove trailing '}' 48 super.toString[1 .. $-2], current, total );
47 + " current=" + current
48 + " total=" + total
49 + "}";
50 } 49 }
51 } 50 }